# How to bind data for multistate indicator from SQL query

**URL:** <https://forum.inductiveautomation.com/t/how-to-bind-data-for-multistate-indicator-from-sql-query/83777>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [January 4, 2024, 6:37am UTC](https://forum.inductiveautomation.com/t/how-to-bind-data-for-multistate-indicator-from-sql-query/83777 "2024-01-04T06:37:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Govind\_Suthar1](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@Govind\_Suthar1](https://forum.inductiveautomation.com/u/Govind_Suthar1)\
**Post date:** [January 4, 2024, 6:37am UTC](https://forum.inductiveautomation.com/t/how-to-bind-data-for-multistate-indicator-from-sql-query/83777/1 "2024-01-04T06:37:25Z")

</div>

Hello Friends,

I want to bind data for multistate indicator using SQL query, I tried that, but it's an error occurred. So, I found the root cause of the error, if using SQL query doesn't bind the data for multistate indicator, because it is the colour object, you can use scalar query to bind the data.

How to use a scalar query for multistate indicator colour binding through DB?

PFA pictures for your ref.

Error

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/a/4a1851266d85daea05a2fc145c476208b5f8b949.png)

SQL query

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/8/c814a34b43cc833ff30f4ef3c3af809ff4cfb8de.png)

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [January 4, 2024, 7:28am UTC](https://forum.inductiveautomation.com/t/how-to-bind-data-for-multistate-indicator-from-sql-query/83777/2 "2024-01-04T07:28:47Z")

</div>

Is this in Vision or Perspective?

I would suggest making an SQL Tag and place this query in the tag settings.  
Then bind the tag to change colours like you would any other tag values.

---

<div class="post-metadata">

**Author:** ![Govind\_Suthar1](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@Govind\_Suthar1](https://forum.inductiveautomation.com/u/Govind_Suthar1)\
**Post date:** [January 4, 2024, 12:18pm UTC](https://forum.inductiveautomation.com/t/how-to-bind-data-for-multistate-indicator-from-sql-query/83777/3 "2024-01-04T12:18:57Z")

</div>

> [@David\_Stone](#):
>
> Then bind the tag to change colours like you would any other tag valu

Hello David\_Stone

Thanks for reply,

It's a Vison module.

I applied that query in the tag setting and it's working now.
