Select to view content in your preferred language

Enable Pop-ups in ArcGIS Online with Hyperlinks

14418
7
Jump to solution
10-11-2018 11:39 AM
SteveRhyne2
Occasional Contributor

I created several (150) PDFs from data driven pages and I want to store them in ArcGIS Online and link them to a point layer. However, I have found that I had to copy the PDF URL and paste it in a field used for the hyperlink in the point layer. Through the pop-up configuration I would point it to the field storing the PDF URL and WhaLa!, the PDF opened. However, I don't want to do this for every PDF and rather automate this some how. Is there a way to calculate the link into the hyperlink field?

Any assistance is very appreciated.

Thanks!

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
MikeMinami
Esri Notable Contributor

Here are a few ideas if you're working with a hosted feature layer and one of the fields in your layer helps determine the unique name of your PDF file. For example, say you have a parcel layer, where the PDF is uniquely named with the Parcel ID.

If you want to explicitly store a hyperlink as the value in a field, you could calculate the field by concatenating static values in other fields, with static text strings. For example, here's a SQL calculate expression:

CONCAT (CONCAT ('http://www.esri.com/somedir/', PropertyID), '.pdf')

which would yield

http://www.esri.com/somedir/12345.pdf

Alternatively, if you don't want to store something directly as a field, you can use a custom attribute display of the popup to add a link that includes the PropertyID field, surrounded with { }.

Lastly, you can add an Arcade expression and add it to the popup, which essentially adds a virtual field to the popup.The advantage of using Arcade over creating a custom popup is that it affords greater ability to do string manipulation. For some layers, you can also write Arcade expressions to calculate field values instead of SQL.

The same Arcade expression would look like this.

'http://www.esri.com/somedir/' + $feature.PropertyID + '.pdf'

hope this helps,

Mike

View solution in original post

7 Replies
KarstenRank
Frequent Contributor

The easiest way ist to store the filename in each field used for the hyperlink in the point layer. At the Pop-up configuration you can change Pop-up display to A custom attribute display.

There you can create a link with the url and the filename from the field like

http://www........./{filename}.

Greetings Karsten

0 Kudos
SteveRhyne2
Occasional Contributor

Thanks Karsten. In my continued research that's what I thought but this is my hang up. The PDF is stored in AGOL and I copied the URL to see the path. As I understand it, I would enter http://<server>.maps.arcgis.com/sharing/rest/content/items/{field name} in the popup configuration. However, I get nothing. Is that correct or am I still missing something?

Thanks!

0 Kudos
KarstenRank
Frequent Contributor

I got a link like this: https://ago-item-storage.s3-external-1.amazonaws.com/ ....... afterwards there is an folder and inside the pdf, followed by the token, depending share status.

0 Kudos
MikeMinami
Esri Notable Contributor

The issue may be that you're URL is pointing to the item in ArcGIS Online, not the actual PDF File. Here's the URL to a PDF item that I own. This item is shared publicly. With the '/data' appended, it means you want the data stored with the item, which in this case is the actual PDF File.

https://www.arcgis.com/sharing/rest/content/items/9501d3d574414943bb0792ee484c5693/data 

0 Kudos
MikeMinami
Esri Notable Contributor

Here are a few ideas if you're working with a hosted feature layer and one of the fields in your layer helps determine the unique name of your PDF file. For example, say you have a parcel layer, where the PDF is uniquely named with the Parcel ID.

If you want to explicitly store a hyperlink as the value in a field, you could calculate the field by concatenating static values in other fields, with static text strings. For example, here's a SQL calculate expression:

CONCAT (CONCAT ('http://www.esri.com/somedir/', PropertyID), '.pdf')

which would yield

http://www.esri.com/somedir/12345.pdf

Alternatively, if you don't want to store something directly as a field, you can use a custom attribute display of the popup to add a link that includes the PropertyID field, surrounded with { }.

Lastly, you can add an Arcade expression and add it to the popup, which essentially adds a virtual field to the popup.The advantage of using Arcade over creating a custom popup is that it affords greater ability to do string manipulation. For some layers, you can also write Arcade expressions to calculate field values instead of SQL.

The same Arcade expression would look like this.

'http://www.esri.com/somedir/' + $feature.PropertyID + '.pdf'

hope this helps,

Mike

Laura
by MVP Regular Contributor
MVP Regular Contributor

@MikeMinami 

I have a field with the full name to the location on our internal servers. Is there a way to pull that ID from the link within the popup to connect that ID to my IIS 'link'? I am trying to find a way to do it all within the popup rather than creating new fields in my layer to then repopulate with just that ID

0 Kudos
MikeMinami
Esri Notable Contributor

Popups have evolved a long way since the original post. Unfortunately, I have not evolved with it :-). However, I would imagine that you could write some arcade code to do what you want. Perhaps this help topic will point you in the right direction. 

https://doc.arcgis.com/en/arcgis-online/create-maps/configure-pop-ups-mv.htm#ESRI_SECTION1_F5CB09E03...

0 Kudos