Cell template - Handlebar condition not working


#1

Hi,
I can’t wrap my head around this especially since I made it work for the map…


As you can see if I simply display the data, it is data.alert_12hr is a boolean.
Now, I want to add images red/green icon and I bump into an issue. For some reason it doesn’t work:

What am I missing here??
Thanks!


#2

Hello,

You’re really close with this. Once you’ve defined your “Source” (as alert_12hr), you then reference that as value in the “Cell Template”. You can read more about configuring a Device State Table block, but the relevant bit is:

In the Cell template, the name variable is available, as well as a value variable, which is the actual value backing that cell.

So for your situation, your “Cell Template” might look like this:

{{#if value}}
  ![](https://dummyimage.com/24/00aa00/00aa00)
{{else}}
  ![](https://dummyimage.com/24/aa0000/aa0000)
{{/if}}

Those dummy images are for green and red blocks respectively.