Is it possible to configure an AGO pop-up so that a field is only displayed in the pop-up when the value is not null?
In other words, I have a specific attribute (Coal Gas Sites) that is only populated for a number of the total number of sites in my feature service. I would only like to display the Coal Gas Sites attribute in my pop-up window when the value is not null and not have it present when the value is null. Can this be done?
Solved! Go to Solution.
We tweaked the HTML and Arcade code that was provided via this forum and found that the following worked:
Fields to be displayed in the Pop-Up (NPL Status is the field with Null values):
Site ID: {SITE_ID}
PI Name: {PI_NAME}
Status: {STATUS}
NPL Status: {NPL_STATUS}
HTML Code for the Pop-Up Configuration:
<b>Site ID:</b> {SITE_ID}<br />
<b>PI Name:</b> {PI_NAME}<br />
<b>Status:</b> {STATUS}<br />
<span style="display:{expression/expr0}">
<b>NPL Status: </b>{NPL_STATUS}
</span>
Custom Attribute Expression in Arcade needed to remove both the field name and value when null :
IIF(isEmpty($feature.NPL_STATUS), "none", "inline")
No I do not believe so, it is an all or nothing.
I take it back. Have the feature in your web map two times using filters to make it visible if that field is null and not visible if that field is null and have it turned off in the pop up if the field is null
Hi Joe,
This can be accomplished with Arcade. Check out the following blog post:
Thanks!
Joe Stefanoni, GIS Specialist
NJDEP Site Remediation Program
(609) 633-1405
joe.stefanoni@dep.nj.gov
We tweaked the HTML and Arcade code that was provided via this forum and found that the following worked:
Fields to be displayed in the Pop-Up (NPL Status is the field with Null values):
Site ID: {SITE_ID}
PI Name: {PI_NAME}
Status: {STATUS}
NPL Status: {NPL_STATUS}
HTML Code for the Pop-Up Configuration:
<b>Site ID:</b> {SITE_ID}<br />
<b>PI Name:</b> {PI_NAME}<br />
<b>Status:</b> {STATUS}<br />
<span style="display:{expression/expr0}">
<b>NPL Status: </b>{NPL_STATUS}
</span>
Custom Attribute Expression in Arcade needed to remove both the field name and value when null :
IIF(isEmpty($feature.NPL_STATUS), "none", "inline")