Select to view content in your preferred language

hyperlinks are not working

212
2
4 weeks ago
L77
by
Frequent Contributor

I am building an experience builder app to replace my web app builder app and I can't get the document hyperlinks to work in the pop up window like they did in experience builder.

I have hyperlinks to my monuments, short plats, large lots, subdivisions, and road documents that are all essential to our business to be linked in the pop up window.

I tried copying over the code I had in web app builder but couldn't get it to work for any of the assets.

Here is a link to a post I made on the subject a few months ago but I didn't get any suggestions from anyone on how to get it to work.

https://community.esri.com/t5/arcgis-online-questions/map-viewer-need-a-hyperlink-in-pop-up-window-t...

With web app builder being phased out at the end of the year I am very concerned about getting this up and running so our staff can learn to use the app.

I attached documents with screenshots from how the data was configured in Map Viewer Classic and web app buider for each dataset.

0 Kudos
2 Replies
gis_KIWI4
Frequent Contributor

I have answered your previous post but I'll post the solution here just incase you miss it 🙂 

===================================================================

 

@L77 it's the "{" that are the problem in URL that are the problem. You are doing everything right, it's just the way it parses that expression that's causing the issue. 

As a test I used the URL - "https://www.google.com/" it works fine. 
In fact, it even recognizes the attribute value as a URL in the pop-up without any configuration

gis_KIWI4_0-1736998373592.png

 


What I would suggest is that you encode the special characters. 

// Arcade Expression

// 1. Original URL with special characters
var fullUrl = "https://www.cowlitzinfo.net/WLAudPublicWorks/Search.aspx?dbid=0&repo=CCIMAGES&searchcommand={[AUD - Recorded Documents]:[Rec Doc AFN]=3102328}";

// 2. Manually replace special characters with percent-encoded values
var encodedUrl = Replace(fullUrl, " ", "%20");
encodedUrl = Replace(encodedUrl, "{", "%7B");
encodedUrl = Replace(encodedUrl, "}", "%7D");
encodedUrl = Replace(encodedUrl, "[", "%5B");
encodedUrl = Replace(encodedUrl, "]", "%5D");
encodedUrl = Replace(encodedUrl, "=", "%3D");

// 3. Return the fully encoded URL
return encodedUrl;

 

fullURL can be set to whatever attribute has the URL in it. 
I can't test it but it looks like it might work. 




gis_KIWI4_2-1736998483767.png

 

 

0 Kudos
Laura
by MVP Regular Contributor
MVP Regular Contributor

For hyperlinks I personally set up a IIS site and have agol/portal reference the IIS site to display the pdfs. 

0 Kudos