Default Image block fallback

I think what you are looking for is the {{defaultTo}} helper.

If you are storing the URLs on a device tag called “imageUrl”, you could reference that value through a device context variable (called “deviceId” in this example):

{{ctx.deviceId.tags.imageUrl}}

Then, fall back to a default image of your choice if that value is not set:

{{defaultTo ctx.deviceId.tags.imageUrl 'https://placekitten.com/640/640'}}
1 Like