Hello,
I'm trying to create an attribute in a popup (map viewer) using an expression that combines an attribute value + URL. I want the user to see the value and be able to click on a link to an external service with more details, if he so desires.
Map viewer conveniently converts all "https://" URLs into "View":
But not with the concatenate function?
Example: Concatenate($feature["BFS_EGID"]," ","https://map.geo.admin.ch/")
Results in:
I want:
1026838 View
Is that even possible?
One way i just found is to use HTML in the rich text editor: https://doc.arcgis.com/en/arcgis-online/reference/supported-html.htm
I would have to create a feature table from scratch, standards hrefs work fine. HTML in expressions doesn't seem to be possible.
🤔
Maybe?
As you've found, expression-based URLs will not work when the expression is directly being read as an attribute. However, if you add an Arcade element to the popup itself, you'll be able to accomplish this, as it interprets HTML tags correctly.
var id = $feature["BFS_EGID"]
var url = 'https://map.geo.admin.ch/'
var out_txt = `${id}
<a href="${url}">View</a>`
return {
type : 'text',
text : out_txt
}
Nice