Select to view content in your preferred language

Hyperlink to URL Arcade

300
1
Jump to solution
08-23-2024 03:01 PM
Labels (1)
Brian_McLeer
Frequent Contributor

I am trying to use a text element with two attribute expressions. I want the URL field in the pop-up to hyperlink to the URL, but have it display "Click here for more info." I can get it to hyperlink to where I want it to go, but it is showing the full URL, not the alias I am looking for. Currently, this is what it shows. 

Brian_McLeer_0-1724450493731.png

 

1st expression {expression/expr0}

var annexYear = $feature.ANNEX_YEAR;
var annexDate = $feature.ANNEX_DATE;
var acres = $feature.ACRES;
var name = $feature.ANNEX_NAME;
var annexationDate = Text($feature.AnnexationDate, "MMMM D, YYYY");

return 	"Annex Year: " + annexYear + "\n" +
 		"Annex Date: " + annexDate + "\n" +
		"Acres: " + acres + "\n" +
		"Name: " + name + "\n" +
		"Annexation Date: " + annexationDate + "\n";

2nd expression {expression/expr1}

var link = 'https://server.domain.com/maps/' + UrlEncode($feature.URL);

return link

Text element:

{expression/expr0} URL: {expression/expr1} 

 

Brian
0 Kudos
1 Solution

Accepted Solutions
Brian_McLeer
Frequent Contributor

I think I answered my own question. You can edit the HTML in the text element, but the OK button gets greyed out. You have to exit the HTML mode then click ok. 

 

Brian_McLeer_0-1724450910390.png

Brian_McLeer_1-1724450941054.png

Brian_McLeer_2-1724450951859.png

 

Brian

View solution in original post

Tags (1)
0 Kudos
1 Reply
Brian_McLeer
Frequent Contributor

I think I answered my own question. You can edit the HTML in the text element, but the OK button gets greyed out. You have to exit the HTML mode then click ok. 

 

Brian_McLeer_0-1724450910390.png

Brian_McLeer_1-1724450941054.png

Brian_McLeer_2-1724450951859.png

 

Brian
Tags (1)
0 Kudos