Attempting to use logical functions to determine when fields appear on pop-up.

07-29-2019 04:57 PM
New Contributor

Hi All, 

I have successfully created a logical function using IIF but the end result is not appearing as I'd like. 

I followed this previously asked question: as what I want is similar. It seems like using the IIF would not cause my expression to show up on the pop-up if it was FALSE.

Below is my expression. The expression is labelled "Custom" 

IIF($feature["TYPE"]=='STRAW', $feature["TYPE"],"")


The function works as expected and it returns this on my pop-up


My issue though is if $feature["TYPE"] != 'STRAW' my pop-up displays 


What I want is if it is False for it not to appear on my pop-up. What am I doing wrong or misunderstanding? 

0 Kudos
1 Reply
Esri Esteemed Contributor

Hi Quang Tran ,

Unfortunately how you want the expression to work, is not the way the function works. When your expression returns an empty string the empty string will be shown together with the name of the expression ("custom" in your case).  In ArcGIS Pro you would be able to create HTML in your expression and create the visualization as you want to obtain, but in ArcGIS Online, this is not possible (yet?). 

There is a different way to do this, but it will require more work and more expressions. You can create a custom HTML pop-up and embed Arcade expressions in the html and force elements to be hidden if for instance a field is empty or does not have a value you want to show. An example you can find here: