# Cell template - Handlebar condition not working

**URL:** <https://forums.losant.com/t/cell-template-handlebar-condition-not-working/741>\
**Category:** Help\
**Created:** [January 18, 2018, 4:15pm UTC](https://forums.losant.com/t/cell-template-handlebar-condition-not-working/741 "2018-01-18T16:15:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![francois\_Oudot](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@francois\_Oudot](https://forums.losant.com/u/francois_Oudot)\
**Post date:** [January 18, 2018, 4:15pm UTC](https://forums.losant.com/t/cell-template-handlebar-condition-not-working/741/1 "2018-01-18T16:15:29Z")

</div>

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

 ![01 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/1X/e4a17c1543a71fbbc2a395b3f1567ee593bfb852.png)  
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:  
 ![35 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/1X/8bffd273afa136a7019dd2cebebfec86bf60cb2e.png)  
What am I missing here??  
Thanks!

---

<div class="post-metadata">

**Author:** ![Rob](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/rob/32/384_2.png) [@Rob](https://forums.losant.com/u/Rob)\
**Post date:** [January 18, 2018, 5:11pm UTC](https://forums.losant.com/t/cell-template-handlebar-condition-not-working/741/2 "2018-01-18T17:11:38Z")

</div>

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](https://docs.losant.com/dashboards/device-state-table/), 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:

```md
{{#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.
