Url link for each feature in feature service

773
7
04-21-2023 05:10 PM
saraswathiemani2
New Contributor III

I am trying to link url to each attribute value of a field of a hosted feature service in arcgisonline.

saraswathiemani2_0-1682122052353.png

something similar to this.

Reg id is the field name in the attribute table of the hosted feature layer. For each value in the Reg ID column can I link an URL, so when the user clicks on the value (for eg. 800940), a web url opens.

Thanks in advance

Sara

 

0 Kudos
7 Replies
JoshuaSharp-Heward
Occasional Contributor III

Hi Sara,

Would you be wanting to have the URL differ for each value by appending the RegID value on the end? I would recommend having an arcade expression that concatenates a base url with the RegID value and has that as a field in the features popup, something like:

var RegID = $feature.RegID
var BaseURL = "yourUrl"
return BaseURL + Text(RegID)

Or you can have custom text in the popup with a hyperlink, so it displays the RegID with the hyperlink being "yoururl{RegID}"

0 Kudos
saraswathiemani2
New Contributor III

Thank you for the reply and the arcade expression.

Yes, I like to have the URL differ for each value by appending the RegID value on the end.

In the pop-up, it's working but I would like to have it in the table for each attribute value of the field (REG_ID) column. When the table is open, the user can click on the attribute value in the field and go to the link. In the screenshot above, Reg id is one of the column in the table with attribute values. for eg. when they click on value 800940, below URL should open. 

https://gisweb.azwater.gov/WellRegistry/Detail.aspx?RegID=800940

 

0 Kudos
JoshuaSharp-Heward
Occasional Contributor III

What sort of a web application are you using this in, an ArcGIS Dashboard or something else? I think you'd be able to do this in a data expression in a dashboard, but if you're aiming for a table in a Web AppBuilder or Experience Builder application you may have to settle for adding another field to your feature service and calculating it with the base URL and REG_ID value.

0 Kudos
saraswathiemani2
New Contributor III

I am using it in the Experience Builder application. Looking for a way not to show the complete long URL. But it looks like on the web map in AGOL or in Experience Builder we cannot make a hyperlink to the values in the field column. 

0 Kudos
JoshuaSharp-Heward
Occasional Contributor III

Yeah I don't think so unfortunately, the only other way I could think of would be formatting it in another column using HTML, but I suspect that HTML isn't actually supported for attribute tables.

0 Kudos
saraswathiemani2
New Contributor III

Thank you for looking into it. 

0 Kudos
saraswathiemani2
New Contributor III

I have an update on the above question. I am able to link the attribute value to the URL.

In ArcGISPro, created the values with the Base URL + {Regid}, and published to ArcGIS online. The feature layer table values show with the underline, specifying the values are clickable. However, for experience builder, the underline is missing but the value is clickable and takes to the correct URL. 

 

 

 

0 Kudos