HOW TO

Add a name for an attachment to a pop-up in ArcGIS Online

Last Published: January 12, 2023

Summary

When adding features with photo attachments to a map, the pop-up can be configured to display the attachments by selecting the Gallery option in the 'Display attachment as' pop-up setting. However, when selecting the Gallery option, no attachment name is displayed. As a solution, the attachment title can be specified and displayed on the pop-up in the Title section of the settings. Another alternative is to use an Arcade expression to specify the name as the attachment title in the pop-up, and this article describes the workflow.

The following image shows an attachment without the title in the pop-up.

The image below shows the attachment without a title

Procedure

  1. In ArcGIS Online, open the desired data in Map Viewer. This workflow uses Rest Canopy as an example.
  2. In Map Viewer, on the Contents (light) toolbar, click Pop-ups.
Navigate to Pop-up
  1. On the Pop-ups pane, under Options, click Attribute expressions.
Navigate to Attribute expression
  1. Click Add expression.
Add an expression
  1. Insert the scripts described below into the expression textbox.
  • For a single attachment, insert the following script.
var Attachment_name = Attachments($feature)
Attachment_name[0].name
  • For multiple attachments, insert the following script.
var Attachmentname = Attachments($feature)
var namelist = [];
for (var a in Attachmentname){ 
    Insert(namelist,a, Attachmentname[a].name )
}
return namelist
  1. Click Done.
  2. Return to the Pop-ups pane and scroll down to Attachments.
  3. Under Title, click the Add field icon Add field icon next to the Title textbox.
  4. Select the expression created in Step 5. The attachment now includes the attachment filename in the pop-up.

The following image shows the attachment with the title in the pop-up.

The title appears on the attachment

Article ID: 000027123

Software:
  • ArcGIS Online

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options