I want to download attachments from an ArcGIS Online Feature Layer and use them for further operations. So far, I did this using
search_result = gis.content.search(ArcGIS_content, "Feature Layer")
item = search_result[0]
FeatureLayer = item.layers[0]
FeatureObjectIDs = FeatureLayer.query(where = "1=1", return_ids_only = True)
for objID in FeatureObjectIDs["objectIds"]:
print("Checking object", str(objID) + "...")
attachments_list = FeatureLayer.attachments.get_list(oid = objID)
in order to get the object IDs and then iterate through all items of the Feature Layer. However, this takes a lot of time and few items actually have an attachment. How can I change the where parameter so I get only the object IDs of objects with an attachment?