# Markdown #eq not comparing strings

**URL:** <https://forums.losant.com/t/markdown-eq-not-comparing-strings/4637>\
**Category:** Help\
**Tags:** dashboard\
**Created:** [July 12, 2022, 9:00am UTC](https://forums.losant.com/t/markdown-eq-not-comparing-strings/4637 "2022-07-12T09:00:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Picalz](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/picalz/32/4081_2.png) [@Picalz](https://forums.losant.com/u/Picalz)\
**Post date:** [July 12, 2022, 9:00am UTC](https://forums.losant.com/t/markdown-eq-not-comparing-strings/4637/1 "2022-07-12T09:00:29Z")

</div>

I have an issue with Markdown inside a GPS history block.  
I’m trying to display specific attributes based on a devices tag (.Template, in this case), but the code below does not work, and i can not figure out why…

```auto
##### [{{deviceName}}](https://XXX.onlosant.com/?device={{deviceId}})
{{#if isLastPoint}} 
#######(Current Location){{else if isFirstPoint}} (Starting Location)
{{/if}}
{{#eq deviceTags.Template "Weather Station"}}
##### Rain Fall: {{data.Rainfall}} mm
##### WindspeedAVG: {{data.WindSpeedAverage}} m/s
{{/eq}}
{{#eq deviceTags.Template "Tank Level"}}
##### Level: {{data.Level}} m 
{{/eq}}
###### Dev Temp : {{deviceTags.Template}}

```

The last `###### Dev Temp : {{deviceTags.Template}}` works perfectly, and returns the exact text I am comparing to using `{{#eq}}`.

Any help will be appreciated!

---

<div class="post-metadata">

**Author:** ![Sebastian\_Turner](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/sebastian_turner/32/4024_2.png) [@Sebastian\_Turner](https://forums.losant.com/u/Sebastian_Turner)\
**Post date:** [July 12, 2022, 1:47pm UTC](https://forums.losant.com/t/markdown-eq-not-comparing-strings/4637/2 "2022-07-12T13:47:45Z")

</div>

Hello Picalz and welcome to the Losant Forums!

What you’re seeing here is a bit of a quirk with Handlebars.

`deviceTags.Template` is actually an array. If you render an array (`{{deviceTags.Template}}` ), it renders them as comma-separated values. When the array has one item in it as it does in this case, that gives the same result as `{{deviceTags.Template.[0]}}`.

However, our `{{#eq}}` block helper does not behave the same way when handed an array as one of the values to compare.

So what’s actually happening here is you’re comparing the array `{{deviceTags.Template}}` to the string “Weather Station”.

What you should try do instead is compare the first item in the array to that string - `{{#eq deviceTags.Template.[0] 'Weather Station'}}`.

Let us know how it goes!

---

<div class="post-metadata">

**Author:** ![Picalz](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/picalz/32/4081_2.png) [@Picalz](https://forums.losant.com/u/Picalz)\
**Post date:** [July 12, 2022, 7:30pm UTC](https://forums.losant.com/t/markdown-eq-not-comparing-strings/4637/3 "2022-07-12T19:30:46Z")

</div>

Hi Sabastian,

Thank you very much!  
This solves it 100%. Ill have to keep this behavior in mind going further 🙂 .
