1

I have a feature service in ArcGIS Online that has attachments enabled. We upload photos of sidewalk trip hazards that have been painted by the city.

I have several queries setup with the Query widget to search for the date sidewalks were painted and other filters, but I want to be able to search for features that have photos attached.

Is there a way to query for and quickly locate features that have attachments without having to click through them until I see one with an attachment link?

10
  • 1
    You could do something like this linked Show Attachments as fields where you could detect if the field had a value or no value at all community.esri.com/docs/… Commented Oct 10, 2017 at 15:13
  • That link provides an option to view the attachments per feature selected individually rather that locating all features that have attachments.
    – whyzar
    Commented Oct 10, 2017 at 15:16
  • 1
    I would do what Russ said, check to see if the field has a value or not.do not show NULL values.
    – NULL.Dude
    Commented Oct 10, 2017 at 15:16
  • Did you want to query in ArcGIS online or what you be okay with export in viewing outside of the Online environment?
    – whyzar
    Commented Oct 10, 2017 at 15:18
  • I can already view which records have attachments by relating the ATTACH table in ArcMap, but I want to be able to see them in ArcGIS Online specifically.
    – cbunn
    Commented Oct 10, 2017 at 15:37

2 Answers 2

0

The question is old and probably no longer needed. However, given how easy this is in 2019 with a little bit of puzzle solving, I will list one way of doing this:

Get Feature Attachments

  1. Get the service URL of the feature/layer. This is through the ArcGIS online service.

  2. Craft new URL as the combination of the following strings: HTTP:// [service URL]/[Feature Object ID]/attachments?f=json&token=

  3. Visit URL and this will give you a text string of the feature with a list of attachments.

  4. Run this for all of the features you are querying.

Scan multiple URLs and retrieve its results:

Use a combination of Excel (2013 and later) and its WEBSERVICE function. Excel has filtering abilities.

  1. Filter out features with no attachments.
0

I finally revisited this and was able to create a solution using a definition query on my layer that is related to the ATTACH table. I simply had to apply this definition query to the layer:

GlobalID in (Select REL_GLOBALID FROM featureclass__ATTACH where ATTACHMENTID > 0)

This creates a layer that only shows features that have a related attachment, in this case pictures. The layer updates as new attachments are added and the database is compressed. See this thread for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.