# Equipment scheduler conditional coloring

**URL:** <https://forum.inductiveautomation.com/t/equipment-scheduler-conditional-coloring/100589>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 8, 2025, 2:19pm UTC](https://forum.inductiveautomation.com/t/equipment-scheduler-conditional-coloring/100589 "2025-01-08T14:19:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hasan\_Ozyavru](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@Hasan\_Ozyavru](https://forum.inductiveautomation.com/u/Hasan_Ozyavru)\
**Post date:** [January 8, 2025, 2:19pm UTC](https://forum.inductiveautomation.com/t/equipment-scheduler-conditional-coloring/100589/1 "2025-01-08T14:19:07Z")

</div>

Hi,  
I would like to use Equipment Schedule as a downtime followup tool. I have setup the related parts and achieved following:  
[EquipmentScheduleBarColor.pdf](https://forum.inductiveautomation.com/uploads/short-url/eyfeYlSinBp2YfXISEQwnOTJ7ff.pdf) (151.4 KB)  
I would like to follow up 8 different reasons and would like to color the related bar based on the content of the related reason.  
So I would like to color the bar on EquipmentSchedule based on the value on a table-column or db-table-column of the equipment schedule bar. eg. If no entry then black, if "Vacation" written then "green"...

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 8, 2025, 2:52pm UTC](https://forum.inductiveautomation.com/t/equipment-scheduler-conditional-coloring/100589/2 "2025-01-08T14:52:35Z")

</div>

Typically, the data for your equipment schedule would be coming from a database. In that case, you just write a case statement in the SQL to output a color based on another column value.

---

<div class="post-metadata">

**Author:** ![Hasan\_Ozyavru](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@Hasan\_Ozyavru](https://forum.inductiveautomation.com/u/Hasan_Ozyavru)\
**Post date:** [January 8, 2025, 5:38pm UTC](https://forum.inductiveautomation.com/t/equipment-scheduler-conditional-coloring/100589/3 "2025-01-08T17:38:19Z")

</div>

Hi, Thanks for your reply.  
I specifically need to know how each individual bar will be colored based on the data in the respected column. Where exactly to bind for individual bars(events)?  
Or should I have a loop?  
Perhaps, a bit more clarification from you will help.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 8, 2025, 6:08pm UTC](https://forum.inductiveautomation.com/t/equipment-scheduler-conditional-coloring/100589/4 "2025-01-08T18:08:47Z")

</div>

I use a query to create my events data, here is an example of how I can change background color based on some other column (plant number in this case).

```python
SELECT 
	tx_id as eventId,
	start_time as startDate,
	end_time as endDate,
	driver as itemId,   
	trailer_id as label,
	lead_time as leadTime, 
	case 
		when to_plant = 1 then '#00FFFF' 
		when to_plant = 3 then '#FFFF47' 
		when to_plant = 4 then '#FF47FF'
		when to_plant = 6 then '#FFAC47' 
		else '#AAAAAA' 
	end as backgroundColor, 
	'black' as fontColor,
	'solid' as borderStyle,
	1 as borderWidth,
	'var(--neutral-70)' as borderColor
	
FROM 
...

```

---

<div class="post-metadata">

**Author:** ![Hasan\_Ozyavru](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@Hasan\_Ozyavru](https://forum.inductiveautomation.com/u/Hasan_Ozyavru)\
**Post date:** [January 8, 2025, 8:55pm UTC](https://forum.inductiveautomation.com/t/equipment-scheduler-conditional-coloring/100589/5 "2025-01-08T20:55:08Z")

</div>

Thanks for the solution.
