Hello Esri Community! I am looking for help with a seemingly simple task: within a popup text element, I want to display a clickable hyperlink for a record if it exists.
The closest I have come is using this Arcade expression and text element configuration... however the 'View Link' text shows as un-clickable link if URL not populated; not ideal.
I want the 'View Link' clickable text to only show if link present. Can someone explain how this can be accomplished? Thanks in advance!


// Reference your attribute field containing the URL
var myUrl = $feature.ASBUILTS;
// Check if the field is empty or null
if (IsEmpty(myUrl) || Trim(myUrl) == "") {
return ""; // Return nothing if it doesn't exist
} else {
// Return a formatted HTML link if it does exist
//return '<a href="' + myUrl + '" target="_blank" rel="noopener noreferrer">Visit Website</a>';
return myUrl;
}