HOW TO
In Portal for ArcGIS and ArcGIS Online Map Viewer Classic, Arcade expressions can be used to apply conditional formatting in the pop-up to hide or display specific text or hyperlinks to external web pages pertaining to the field value. This article provides an example and instructions using Arcade expressions to display hyperlinks based on conditions in pop-ups of Map Viewer Classic.
return iif($feature.<fieldName> == <fieldValue>, '<fieldValue1>', '<fieldValue2>')
The code below is an example of the full working script.
return iif($feature["LEVEL_NO"] == 6, 'College Application Available', 'College Application Not Available')
return iif($feature.<fieldName> == <fieldValue>, 'inline', 'none')
The code below is an example of the full working script.
return iif($feature["LEVEL_NO"] == 6, 'inline', 'none')
{expression/expr0} <a href="<webpageURL>" style="display:{expression/expr1}" target="_blank" rel="nofollow">(<b><URLDisplayText></b>)</a>
The code below is an example of the full working script.
{expression/expr0} <a href="https://portlandbiblecollege.org/admissions/apply-now/" style="display:{expression/expr1}" target="_blank" rel="nofollow">(<b>Apply Now</b>)</a>
The image below shows the configured pop-up whereby the pop-up displays the hyperlink when the point selected is a college.
The image below shows the configured pop-up whereby the pop-up does not display the hyperlink when the point selected is not a college.
Get help from ArcGIS experts
Download the Esri Support App