Use URL from attribute table in text widget

606
5
Jump to solution
11-09-2022 01:21 PM
Labels (1)
ZachBodenner
MVP Regular Contributor

Hello,

I have a feature class in a web map that has an attribute containing a URL link to each location's web page. I was to use this URL in a text box with the dynamic text function, but I don't want the entire URL to be exposed. Instead I would rather have the link read something like "Visit this site's web page."

ZachBodenner_0-1668028818510.png

I didn't expect this particular setup to work and was not surprised.

Is there a way to use a href or some other HTML to do this? 

Tags (3)
0 Kudos
2 Solutions

Accepted Solutions
TonghuiMing
Esri Regular Contributor

@ZachBodenner Instead of using the Attribute, try using the Expression:

TonghuiMing_1-1668395379975.png

 

 

View solution in original post

0 Kudos
TonghuiMing
Esri Regular Contributor

@ZachBodenner  - I guess earlier I understood your case a bit off. If using the above solution, before each record is selected it will show the label, but it will display the value of your {URL}.

 

In your case, you can just use a text widget, and type in the string "Visit Website"; then connect with your data and link to a dynamic URL here:

TonghuiMing_0-1668566515113.png

 

View solution in original post

0 Kudos
5 Replies
TonghuiMing
Esri Regular Contributor

@ZachBodenner Instead of using the Attribute, try using the Expression:

TonghuiMing_1-1668395379975.png

 

 

0 Kudos
ZachBodenner
MVP Regular Contributor

Exactly what I was looking for, thanks so much!

ZachBodenner
MVP Regular Contributor

Well after doing more testing it turns out I might have jumped the gun on accepting this solution. So I was able to successfully get the expression to show "Visit Website" but when I actually deploy the application, it doesn't hold and instead shows the whole URL.

 

ZachBodenner_0-1668542123613.png

ZachBodenner_1-1668542138271.png

ZachBodenner_2-1668542158969.png

 

0 Kudos
TonghuiMing
Esri Regular Contributor

@ZachBodenner  - I guess earlier I understood your case a bit off. If using the above solution, before each record is selected it will show the label, but it will display the value of your {URL}.

 

In your case, you can just use a text widget, and type in the string "Visit Website"; then connect with your data and link to a dynamic URL here:

TonghuiMing_0-1668566515113.png

 

0 Kudos
ZachBodenner
MVP Regular Contributor

Ah. Duh. Thank you!

0 Kudos