Hi All, I'm relatively new to Arcade but can't figure out this When function. I have a Right expression that returns the last three characters of a field $feature.info_headline when applied as a separate arcade expression. However when I apply the same expression as a variable in front of a When expression I get no errors when tested but also no results are returned? Can someone point me where I am going wrong with this expression? Is there a rule about variables I am missing?
var right3 = Right($feature.info_headline, 3);
var warning_level = When(right3=='Red', 'Red', right3=='nge', 'Orange', 'Watch');
I'm trying to get the expression to populate a new Color Style such that if the last three characters in the field $feature.info_headline are 'Red' the value returned is 'Red', or if he last three characters are 'nge' the value returned is 'Orange', else return 'Watch'.
I know there might be some options using nested IIf functions but thought the When function would be simple enough to do what I am trying.