# Change Template background colour by sql in vision

**URL:** <https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [December 12, 2022, 7:09am UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484 "2022-12-12T07:09:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aman\_sharma](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@aman\_sharma](https://forum.inductiveautomation.com/u/aman_sharma)\
**Post date:** [December 12, 2022, 7:09am UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484/1 "2022-12-12T07:09:09Z")

</div>

i have created template and multi instances of component,i want to change the background color of template for particular specific users(using MySQL database) in vision.  
i took a Dropdown component and added users from database. i want to change the background color while selecting specific user.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 12, 2022, 7:47am UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484/2 "2022-12-12T07:47:57Z")

</div>

The dropdown selection triggers a sql query that retrieves the desired background color?

---

<div class="post-metadata">

**Author:** ![aman\_sharma](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@aman\_sharma](https://forum.inductiveautomation.com/u/aman_sharma)\
**Post date:** [December 12, 2022, 11:07am UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484/3 "2022-12-12T11:07:32Z")

</div>

no, what i am doing is.... I have one template and created its multi instances, i wants to change the background color of template which reflect in various instances taken in another screen.i have a database table which include some data having some null values. i took the dropdown and bind with sql query results data in dropdown. now i want to select the data in list of dropdown which having null values which will give the result to change background color of particular that instance which having null value.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [December 12, 2022, 12:17pm UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484/4 "2022-12-12T12:17:52Z")

</div>

> [@aman\_sharma](#):
>
> now i want to select the data in list of dropdown which having null values which will give the result to change background color of particular that instance which having null value.

I'm sorry, but...  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/2/b2167b0aded919e9fba537b4cd2c63ec47f1cd3a.gif)

Let's try to clarify:  
What I understand so far:

- you have a dropdown
- some of its values are null
- the background's color need to change

What I'm guessing:

- the color of the background should change if a null value is selected ?

---

<div class="post-metadata">

**Author:** ![aman\_sharma](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@aman\_sharma](https://forum.inductiveautomation.com/u/aman_sharma)\
**Post date:** [December 13, 2022, 4:11am UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484/5 "2022-12-13T04:11:07Z")

</div>

yes

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 13, 2022, 4:21am UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484/6 "2022-12-13T04:21:05Z")

</div>

This is not difficult. In your property editor for your template's background color, click the binding icon:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/0/30eddf20b011e6ed491d444e84a62486efb14768.png)

Select "Property" for the binding and then tie it to your dropdown's "Selected Value" property:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/5/05cd392600c1412ec39cea30b88feeda23b3b591.png)

Finally, set up whatever colors you want in the Number-to-Color-Translation area, and use the "Low Fallback Color" for the color you want displayed when the value is null:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/c/1c296797bb18786838f6d7a663f090b810933931.png)

---

<div class="post-metadata">

**Author:** ![aman\_sharma](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@aman\_sharma](https://forum.inductiveautomation.com/u/aman_sharma)\
**Post date:** [December 13, 2022, 5:33am UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484/7 "2022-12-13T05:33:45Z")

</div>

i don't see any dropdown option in binding, may be due to my dropdown is in another screen.then how to do this?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 13, 2022, 6:05am UTC](https://forum.inductiveautomation.com/t/change-template-background-colour-by-sql-in-vision/67484/8 "2022-12-13T06:05:01Z")

</div>

> [@aman\_sharma](#):
>
> i took the dropdown and bind with sql query results data in dropdown

Where does the dropdown you spoke of live relative to your template? What is its name?
