Thank you Xander. That was what I was missing. I did some more digging on this, because I was ending up with a lot of blank lines in my popup. I cleaned up my expression and then decided to go the HTML route discussed elsewhere to achieve what I'm wanting. I have the following expression to evaluate if any of the items in the list failed the last inspection (expression/expr0):
var exit_flds = ["Doors", "Corridors", "Stairs", "PanicHardware", "ExitSigns", "EmergencyLighting"];
for (var i in exit_flds){
if ($feature[exit_flds] == 'fail'){
return "inline";
} else {
return "none";
}
Then, I have expressions for each inspection item (6 expressions from exit_flds above):
if($feature.Doors == 'fail'){
return "inline";
} else {
return "none";
}
However, when I use the HTML below, the header (expression/expr0) does not always evaluate to "inline" when it should. For example, the popup on the left displays correctly, whereas the popup on the right has an item that failed, but is not displaying the header.
I have successfully set up a series of else if statements that work, but shouldn't the list do the same thing?
HTML:
<br style="display:{expression/expr0}" /><span style="display:{expression/expr0}"><font color="”#000000”"><b><u>Exits and Passageways</u></b></font></span>
<br style="display:{expression/expr1}" /><span style="display:{expression/expr1}">Doors: unlocked & unobstructed, operational: <font color="#ff0000"><b>Fail</b></font></span>
<br style="display:{expression/expr2}" /><span style="display:{expression/expr2}">Corridors: unobstructed, properly maintained 36” minimum: <font color="#ff0000"><b>Fail</b></font></span>
<br style="display:{expression/expr3}" /><span style="display:{expression/expr3}">Stairs: unobstructed, rails & stairs maintained: <font color="#ff0000"><b>Fail</b></font></span>
<br style="display:{expression/expr4}" /><span style="display:{expression/expr4}">Panic Hardware: existing, operational: <font color="#ff0000"><b>Fail</b></font></span>
<br style="display:{expression/expr5}" /><span style="display:{expression/expr5}">Exit Signs: present, operational: <font color="#ff0000"><b>Fail</b></font></span>
<br style="display:{expression/expr12}" /><span style="display:{expression/expr12}">Emergency Lighting: present, operational: <font color="#ff0000"><b>Fail</b></font></span>