I have looked at several examples of arcade expressions, and have read the ESRI developer manuals online to figure out how to display fields conditionally in popups on ArcGIS Enterprise.
I would like to display 2 fields on the popup in a webmap. If my province code is greater than 59, I want to display fields x12 and x10. Else, I would like to display fields y6 and y4. So, I am trying to display different fields based on the value of another field.
Here is a psuedo-arcade code that does not work! I understand the return statement is not correct
Solved! Go to Solution.
This solution uses template literals and an implicit return
IIf(
$feature.province_code > 59,
`${$feature.both_rate_12}, ${$feature.both_rate_10}`,
`${$feature.both_rate_6}, ${$feature.both_rate_4}`
);
This solution uses template literals and an implicit return
IIf(
$feature.province_code > 59,
`${$feature.both_rate_12}, ${$feature.both_rate_10}`,
`${$feature.both_rate_6}, ${$feature.both_rate_4}`
);
Thanks for your suggestion. I adjusted my code according to your suggestion, but it still does not display any of the fields on the pop-up!
Not sure what could be the reason there.
Can you provide screen shots of your data? And do you want to show the fields as a comma-separated string ("Field1, field2") or a field list like this?
The actual field names are too long, so I'm afraid the screen shot won't show much.
But all the fields are numeric.
Preferably I like to show the fields in table format, like your screen shot. Different provinces show respective values in different fields in my data; that is why I need to customize it to show different fields for different provinces.
I wonder if the version of the enterprise I am using would be a factor, 11.3
I just realized why! Thanks for your help @KenBuja