Row color on report table if, elif, else

priority=="Low"?"916AAD":priority=="Medium"?"F5E11B":priority=="High"?"EC8629":"E22028"

my expression is not working properly
image

followed the examples here

Looks correct... Are you sure priority is the key and it's not just a column in a larger key? like MyData.priority?

yes, its the "priority" key, im using the alarm journal query btw, I already said the data key on the table

Try adding '#' to the color values:

priority=="Low"?"#916AAD":priority=="Medium"?"#F5E11B":priority=="High"?"#EC8629":"#E22028"

thanks but I didn't work

Looks like priority is not evaluating to a string, you have to force it. This works:

priority.toString()=="Low"?"#916AAD":priority.toString()=="Medium"?"#F5E11B":priority.toString()=="High"?"#EC8629":"#E22028"

image

1 Like

Hi! thanks for the solution, i see the problem, yeah the data type of the priority is different.

i hope there will be some data type column in data browser so its much easier to troubleshoot stuff like this hehe