Select to view content in your preferred language

Issue with arcade IIF for background color

484
2
Jump to solution
09-14-2022 08:40 AM
AdejumoBidemi
Occasional Contributor

Hi everyone,

 I'm trying to change background color based on value but the IIF is not working instead the whole list is giving the background color (both 1 & 2 value). Below is my code

var bgcolor = IIF(DomainName($datapoint,'FHE')==1,'#FF0000','');

return {
textColor: '',
backgroundColor: bgcolor,
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
}

any suggestions

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

A "domain name" is pretty much always a string, so comparing the domain name to an integer will always give you the result false. Are you meaning to compare the value of the code?

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

A "domain name" is pretty much always a string, so comparing the domain name to an integer will always give you the result false. Are you meaning to compare the value of the code?

- Josh Carlson
Kendall County GIS
AdejumoBidemi
Occasional Contributor

Yes... I tried using the text value which is Yes/No but I still get the same result

0 Kudos