Change text displayed in ArcGIS Online Pop-Up with Arcade

728
3
01-26-2023 11:07 AM
Labels (1)
Laurenventure
Occasional Contributor

I created an expression with Arcade to go to a hyperlink with a 7 digit code that pulls from a field. 

Arcadecode.PNG

 

 

 

My question is how do I change the Text for the hyperlink?

popup.PNG

The default is 'View', but I'd like to display that 7 digit code from my field. I added this expression into the 'Fields List' in the pop-up configurations.

Apologies if this question has been answered. I'm very new to Arcade and most posts about hyperlinking from the Text option for Pop-Up content.

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

You'll want to add an Arcade element to your popup. This will give you the option to dynamically set HTML elements, and you can return something like this:

var id = left($feature.COA_Prop_ID, 7)

`<a href="https://www.collincad.org/propertysearch?prop_id=${id}">${id}</a>`

This will pipe in your ID to the link URL as well as the placeholder text.

- Josh Carlson
Kendall County GIS
0 Kudos
Laurenventure
Occasional Contributor

This is what I see with your code in the pop-up.popupCODE.PNG

0 Kudos
jcarlson
MVP Esteemed Contributor

Don't put it in a field list. Your popup should let you add an Arcade element.

- Josh Carlson
Kendall County GIS
0 Kudos