A pop-up is a great way to quickly identify the attribute information about a particular feature in a map. But why stop there? You can make your pop-ups functional! Let’s say you want to provide a Survey123 for ArcGIS link so that someone who has visited a location can provide feedback. Or maybe you need to access a digital copy of a legal document stored on your local network. If you want to click on specific features and open an external site, folder, or document then hyperlinks are the key to your success.
In ArcMap you rely on the hyperlink button, commonly called the lightning bolt, to access hyperlinked items, often by concatenating multiple fields together into a unique URL. Similar functionality is available within pop-ups in the 2.1 release of ArcGIS Pro.
There are several ways to add hyperlinks into a pop-up allowing you to design a pop-up that is both functional and looks good. Text, list of fields, charts, and image elements all support hyperlinks. Chart and image elements can expose a link in both the title and caption. With images, the picture itself can be the link. Text elements can be built with embedded hyperlinks. The List of Fields will automatically display recognizable hyperlinks. A clicked link opens in the default application associated with the links file type – for example, a .docx file opens in Microsoft Word.
1. Attribute Driven Links
To define unique endpoints per feature in a layer, you need to include feature attributes in the construction of the hyperlink. The simplest way to do this is to reference a field that contains a fully-defined endpoint, such as “http://myserver.com/availableModels/modelXYZ.html”. Sometimes, however, the information you need to generate a URL needs to come from a combination of multiple fields and perhaps a static component. In these cases, you will need to define an expression inside your layer’s pop-up definition first.
2. Single Field Hyperlinks
Creating a hyperlink on your pop-up with a single field is straight forward. You simply use the name of the field inside curly brackets in the hyperlink section of the element. For example, to make an image element clickable you add {Fieldname} into the hyperlink property box on the Image Options page of the pop-up configuration dialog.
3. Hyperlinks Defined by Expressions
Creating a hyperlink with multiple fields requires more planning. For example, to construct “mailto:bob@me.com” you could reference a combination of static text and fieldnames like “mailto:” + {ManagerEmailName} + “@” + {StoreWebsite}. To do this in ArcGIS Pro you add an Arcade Expression into the layer’s pop-up configuration.
For example:
Once an expression has been created it works much like other fields in the layer. It displays in the List of Fields element and can be used in a hyperlink as {expression/Expression Name}; the “{expression/” portion is hardcoded and the rest is configured as the Name property. Using the example above this would be {expression/Email3}.
4. Launching files
You may want to link to items stored on a local or network drive. For instance, if scanned documents are maintained using filenames that match the name of point features, an attribute-driven link can be made to the files by using the “file:///” prefix. For example: “file:///C:/ScannedDocs/” & {NameOfLocation} & “.pdf”. This link opens a PDF document by that attribute name stored in the local ScannedDocs folder. The same technique can be used with mapped network drives and folders of files. For example: “file:///Z:/NetworkScans/” & {FileNamePlusExtension}. This allows multiple file extensions to be tracked within one field, such as .pdf, .jpg, and .docx. If the containing folders vary based on the project name; you could modify the expression to combine the drive letter, project name field, and full file name: “file:///S:/” & {Project} & “/” & {FileNamePlusExtension}.
5. Launching a web page
You can also link to web pages from a pop-up. These hyperlinks can include parameters, which expands your hyperlink possibilities. For example, you could link to a Survery123 for ArcGIS questionnaire that opens the link and prepopulates form values directly from the GIS feature that was clicked on. Dynamic values, such as the current date and time, can also be included in an HTML-based hyperlink.
These examples show the power of pop-ups. With one click, your users can open a new email with the addressee filled in, open a file in its native application, direct users to a company website, launch a Survey123 for ArcGIS questionnaire, provide access to an ArcGIS Online webmap, and much more.
6. Limitations
Not all clickable links are safe. There are some file extensions you don’t want used in a pop-up. Since executable files (.exe) could be used maliciously against the user’s computer system they are not allowed in pop-ups. If unsupported file types are listed in an attribute field, they will display as a link but will not apply their action when clicked. One other limitation to be aware of is that only one link can be defined per field. If you have multiple file names within a single field, it will be interpreted as one, long, invalid file name.
Adding hyperlinks and actions into a pop-up empowers your data beyond its list of attributes, and delivers functional power to your users. Don’t just take a default pop-up, customize it to its full potential!
Article Discussion: