Arcade expression to change text color based on date

3709
10
Jump to solution
06-24-2020 07:18 AM
AndrewSD
New Contributor III

I need an arcade expression that changes the text color based on age. So if if the age is 5 days or less its green text, between 6-10 days its yellow and 11-15 days is red. I am not that experienced with arcade and I tried to find examples of what I wanted and I tired to make it but could not get it to work. 

var val = $datapoint.Age;

var textColor ="green";
if (val <= 5);
result='green'

var textColor ="yellow";
if (val <= 10);
results='yellow'

var textColor ="red";
if (val >= 13);
results='red'

return results;

I am not sure how to made the range value of between 6-10 days. 

Thank you for any help!

0 Kudos
10 Replies
AndrewSD
New Contributor III

This is exactly what I was looking for! Thank you, you are a lifesaver! 

0 Kudos