Hi. My webmap displays an image in the popup, with the source attribute dynamically created like this:
Edit: I didn't think this through properly--sorry! I'll blame it on it being close to 5 pm. The problem (like you said) is that since there's nothing to indicate whether a record has an image, I'm not sure there's a way in Arcade to actually check if that URL is reachable.
I'll still leave this up in case it helps anyone else, though.
-----------------------------------------------------------------------------------------
@ZorbaConlen, I think you can actually use Arcade here!
I'm assuming this is how you're getting the image into the pop-up:
If so, click on "Attribute expressions" and create an expression something like this:
// The first parameter is your constructed image URL
// The second parameter is your backup/no-image image URL (I grabbed a random image from the ArcGIS blog)
return DefaultValue("https://<domain>/Images/SurveyReports/" + Text($feature.CONTROLID) + ".gif", "https://www.esri.com/arcgis-blog/wp-content/uploads/2025/11/CapBld_WIDE.png")
Once you have that expression created, you should be able to choose it as a "field" (click on the curly brackets):
Hi Nicole. Thanks for the reply.
So, I am able to use an arcade expression. I'm not using the media element, but rather a text element and I configure the img tag in html mode, using the arcade expression for the source attribute. That part is all good. The challenge I'm facing is like this. There are about 5k control points. Most have a corresponding image on my web server, but some don't have an image there. I don't know which points are missing an image, so I'm looking for a way to display an alternate image in the popup for those that don't have one.
Right--I think what you're needing to test is whether the URL is reachable, which I don't think is possible in Arcade right now. I did find this discussion that mentions using a bulk URL status code checker: Solved: Re: Arcade Validate URL in Popup - Esri Community
You could then use the results to create a new field in the data (if you have the appropriate access) to track whether the record has an image, then base your expression on that field:
var image
if ($feature.HASIMAGE == 'Y'){
image = "https://<domain>/Images/SurveyReports/" + Text($feature.CONTROLID) + ".gif"
} else {
image = "https://www.esri.com/arcgis-blog/wp-content/uploads/2025/11/CapBld_WIDE.png" // back-up image
}
return image