HOW TO

View the attachment type and format of a record using Arcade in ArcGIS Online

Last Published: January 2, 2024

Summary

In ArcGIS Online, the file type and format of an attachment in a record can be viewed in a new field of a hosted feature service. This is useful to enhance the organization, accessibility, and analysis of information.

This article provides the workflow to view the attachment type in the Attachments field of a record using ArcGIS Arcade in ArcGIS Online.

Procedure

  1. Log in to ArcGIS Online and click Content > My Content.
  2. Click the hosted feature layer containing the attachments to open the item details page.
  3. Add a new string field in the attribute table of the hosted feature service. Refer to ArcGIS Online: Add a field for instructions.
  4. Calculate the new field to view the attachment types of the record using Arcade. Refer to ArcGIS Online: Calculate values for a field for instructions.
  5. In the Expression window, specify the following Arcade expression:
if(count(Attachments($feature))!= 0)
{
return Attachments($feature)[0]["contenttype"]
}
else
{
return null
}
  1. Click OK.

The attachment types of the record are displayed in the field, as shown in the image below.

The attachment type of a record is displayed in the field

Article ID: 000031603

Software:
  • ArcGIS Online

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options