Hi all,
I'm trying to clean up my tags in my Content.
I'd like to be able to go through and completely remove or edit some of them, without manually changing on each item.
Is this possible?
Thanks!
You can indeed, you can use the Python API to achieve this.
You will need to manually or programmatically get a list of item ids for what you want to update.
Your workflow will resemble similar to below.
## import the GIS module
from arcgis import GIS
## the GIS module acts as an entry point to your AGOL
agol = GIS("home")
properties_dict = {
"tags" : ["tag1", "tag2", "tag3"]
}
## list of content item ids
item_ids = ["ID1", "ID2", "ID3", "IDn"]
## iterate through and update the tags for each
for item_id in item_ids:
item = agol.content.get(item_id)
item.update(item_properties=properties_dict)
An alternative workflow might be to export the name of your content and ids to a CSV/Excel format, add in the tags in another column. Read the file in Python and update each item id based on the tags column.