# What are the exact rules of truthiness-evaluation in a Conditional block?

**URL:** https://forums.losant.com/t/what-are-the-exact-rules-of-truthiness-evaluation-in-a-conditional-block/2290
**Category:** Help
**Tags:** workflow, conditional
**Created:** [October 17, 2019, 12:27am UTC](https://forums.losant.com/t/what-are-the-exact-rules-of-truthiness-evaluation-in-a-conditional-block/2290 "2019-10-17T00:27:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Alexander\_Farley](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/alexander_farley/32/380_2.png) [@Alexander\_Farley](https://forums.losant.com/u/Alexander_Farley)
#### Post date: [October 17, 2019, 12:27am UTC](https://forums.losant.com/t/what-are-the-exact-rules-of-truthiness-evaluation-in-a-conditional-block/2290/1 "2019-10-17T00:27:25Z")

</div>

I was surprised to find that the following does not lead to the “true” path being taken, despite the value of `data.is_end` being set to `true`:

`{{data.is_end}} == true`

Whereas the following expression did take the “true” path:

`{{data.is_end}}`

The value in data.is\_end was inserted by a Mutate node with the value `true`. The debug output shows `data.is_end= "true"` (with the quotes).

My original understanding was that the Mutate node would add a property to the `data` object of type `boolean`. Is this correct? If so, why is my original comparison failing?

---

<div class="post-metadata">

### Author: ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)
#### Post date: [October 17, 2019, 11:59am UTC](https://forums.losant.com/t/what-are-the-exact-rules-of-truthiness-evaluation-in-a-conditional-block/2290/3 "2019-10-17T11:59:20Z")

</div>

So, @Alexander_Farley,

Our templating engine is [HandleBars JS](http://handlebarsjs.com/). So we follow all of the [JavaScript truthiness evaluation](https://www.sitepoint.com/javascript-truthy-falsy/) rules.

In this case, `"true" == true` will result to false.

But, you make a good point about the Mutate Note. For that to evaluate the types as expected, you’ll need to use the “Treat value as JSON” option. ( in the example below, the bottom arrow is after, and the top before )

 ![21%20AM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/c7480c5e337c2fc67369b1197e1a105503f47973.png)

The reason for this is, the result of all templates are strings. Now, Losant is friendly in a lot of places. For example, when you report a boolean state, we do convert the type of that value for you.

However, in this case, it will be a string unless you select that option. Your string will be evaluated as JSON, which has types. It’s almost the equivalent of doing:

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/68f82dde1b62cf74cbc5e885377103362b13bcad.png)
