HOW TO

Query features with no attachments in a layer in ArcGIS Pro

Last Published: August 28, 2023

Summary

If it is necessary to query features that have or don't have attachments, a definition query/filter can be created in ArcGIS Pro by the following basic steps:

  1. Create a new integer field.
  2. Open the Field Calculator.
  3. Use the Arcade expression.
  4. Apply a query.

Procedure

ArcGIS Pro:

  1. Open the layer's attribute table, and in the Field group, click Add, as shown in the next image.

  1. This opens the Fields window. Name the new field, and make sure the Data Type is Short or Long integer, as shown in the next image.

  1. Once this is done, click Save.

  1. Close the Fields window, go back to the attribute table, and click the Calculate button to open the Calculate Field window, as shown below.

  1. In Field Name, choose the field created in Step 2. Make sure that Arcade is selected as the Expression Type, and paste the expression "Count(Attachments($feature));" in the box. Verify that the expression is valid, click Apply, and close the Calculate Field window, as shown in the next image.

This process fills the new field with "1" if the record has an attachment, otherwise, the new field will show a "0", as shown in the next image.

  1. Create a definition query by right-clicking the layer in the Contents pane, and opening its Properties. Click the Definition Query tab. Create the expression, apply it, and click OK.

The same process can be done in ArcGIS Online, refer to this article: How To: Display only features with attachments in Attachment Viewer. Using the same Arcade expression, Count(Attachments($feature));, apply a query to get the features with attachments.

Article ID: 000030974

Software:
  • ArcGIS Pro

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