POST
|
https://community.esri.com/t5/arcgis-online-questions/remove-attachments-in-batches-from-feature-service/td-p/1071639 This doesn't automatically delete them, but if you connect to the portal in ArcPro and run the python script, it removes the images. # Delete all attachments # Instructions from the URL: # https://community.esri.com/t5/arcgis-online-questions/remove-attachments-in-batches-from-feature-service/td-p/1071639 from arcgis.gis import GIS import arcgis from arcgis.features import FeatureLayerCollection gis = GIS("https://www.arcgis.com", "username", "password") # Replace your username and password featureService = gis.content.get('feature service layer id') flayer=featureService.layers[0] #You may need to change layer id from 0 to your own layer number whereclause = "OBJECTID > 0" #for example "status ='done'" queries features where the value in the "status" field is "done" for feature in flayer.query(where=whereclause): f_oid=feature.attributes.get("OBJECTID") #You might need to replace OBJECTID with the name of the objectid field in your dataset. att_list=flayer.attachments.get_list(oid=f_oid) if att_list: for att in att_list: att_id= att['id'] flayer.attachments.delete(f_oid,att_id) print(f"Attachments were deleted for feature {f_oid}") else: print(f"No attachments found for feature {f_oid}") print ("Finished")
... View more
07-21-2023
10:03 AM
|
0
|
0
|
1308
|
POST
|
I tried the 'solution' but the Visualization on the WFL layer has the labels option grayed out. Are there any other methods? I really don't want to have to republish. Seems like it should be an easy step to turn labels on and off. They are on in the Web Map so why not the feature layer? Using app version 23.1.0 Build 984
... View more
06-12-2023
04:10 PM
|
0
|
0
|
2396
|
POST
|
We are also experiencing this problem with the query layer. The attribute table shows 16 records but there are actually 24. If I refresh the query all 24 show up. Scrolling down did not work and sorting didn't either. The view is registered with the geodatabase. If we do additonal filtering with a definition query, the results are accurate. But running the query as the source query layer requires the refresh every time to get the correct number of results in the attribute table.
... View more
04-24-2019
10:14 AM
|
0
|
0
|
1914
|
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|