AnsweredAssumed Answered

Help eliminating empty lines in a custom pop-up using Arcade

Question asked by Lynn_Carlson on Apr 24, 2020
Latest reply on Apr 28, 2020 by xander_bakker

I have created seven Arcade expressions in order to customize a pop up on a hosted feature layer in ArcGIS Online.

Each expression uses IIF to create the text I want to appear in the popup.

Example: if the feature has an attribute trainassist = 'yes', I have the text in the popup say "Training and Assistance"

so my expression consists of:

IIf($feature.TrainingAssist=="yes", "Training and Assistance", " ")


if that same feature has a second attribute combat = 'yes', I have the text in the popup say "Combat"

IIf($feature.Combat=="yes", "Combat", " ")


There are a total of seven attributes that I do this for.  If an attribute doesn't have "yes", I don't want any text to appear, so the else is just " ".


The trouble happens when I create the custom pop up using the Custom Attribute Display.


Simply listing the expressions one after the other results in empty lines in the popup  (the else " ") when the condition of 'yes' is not met. 



I've tried building one combined expression with IsEmpty, and making an array variable, but I am stuck.


I've attached another graphic which goes into further detail.


Thank you in advance for any help!