# Multiple values in one indicator block

**URL:** <https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748>\
**Category:** Help\
**Tags:** dashboard\
**Created:** [March 19, 2020, 2:11pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748 "2020-03-19T14:11:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [March 19, 2020, 2:11pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/1 "2020-03-19T14:11:04Z")

</div>

Trying to use an indicator block to display several pieces of data, but maybe this not possible.

Let’s say I want to query 8 different attributes but only display corresponding text if one or all attributes are ==1.

The purpose is to display an alarm text depending on if proper alarm bit is set. (each bit is an attribute)

---

<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:** [March 19, 2020, 2:12pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/4 "2020-03-19T14:12:08Z")

</div>

@Lars_Andersson,

Yes, this is possible. Using the block you can have multiple queries:

> **[Indicator](https://docs.losant.com/dashboards/indicator/#queries)**
>
> Learn about adding and configuring an Indicator Block on a Losant Dashboard.

Each query will get it’s on variable (`value-0`) that you can use to represent it in your expressions.

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [March 19, 2020, 2:27pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/5 "2020-03-19T14:27:02Z")

</div>

I have tried {{#if value-0}}{{value-0}}{{else}}Not set!{{/if}} , but it cant seem to ever match value-0, I even tried in enclosing as (value-0) , but I must be doing something else wrong.

---

<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:** [March 19, 2020, 2:39pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/7 "2020-03-19T14:39:26Z")

</div>

What’s the type of and current value of the attribute?

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [March 19, 2020, 2:45pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/9 "2020-03-19T14:45:49Z")

</div>

it’s a number, and I just changed to 1, and it now works.  
If I switch back to 0 it doesn’t.

---

<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:** [March 19, 2020, 2:56pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/11 "2020-03-19T14:56:31Z")

</div>

@Lars_Andersson,

First, can you include a screenshot of your block configuration? Screenshots always help us help you.

Secondly, we are talking about the “Label” for the block. However, what do you have as the “Expression” for this label you’re trying to configure?

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [March 19, 2020, 3:03pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/12 "2020-03-19T15:03:42Z")

</div>

I think I have what I need now. The label is configured as foollows:  
{{#if value-0 }}{{value-0}}{{else}}{{/if}}  
{{#if value-1 }}{{value-1}}{{else}}{{/if}}  
{{#if value-2 }}{{value-2}}{{else}}{{/if}}

What I didn’t know whas that when any of the values in the if statements are 0, nothing printed, but if the same value is set with just {{value-0}}, it does print 0.

---

<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:** [March 19, 2020, 3:14pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/14 "2020-03-19T15:14:15Z")

</div>

The expression determines which label gets displayed. If you’re simply trying to display a label for each attribute _and_ the numbers will always be `1` or `0`, you can use the `{{value-x}}` as the expression and you wouldn’t need to use the `#if` helper in the Labels.

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

Expressions determine which Label to display.

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [March 19, 2020, 3:16pm UTC](https://forums.losant.com/t/multiple-values-in-one-indicator-block/2748/15 "2020-03-19T15:16:48Z")

</div>

I was hoping to display all the non zero messages in the same box, and that seems to be possible.
