How can I get a List of ALL TAGS in my Organization?

1288
3
Jump to solution
03-12-2019 01:00 PM
AaronPaul5
New Contributor II

We want to clean out unwanted TAGS from our ArcGIS Online Organization.

Can I use the Python API or something else to do this?

Thank you,

Aaron

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
MunachisoOgbuchiekwe
New Contributor III

Hello Aaron,

You can search by your organization id, then loop though all the items and print out the tags. Below is an example....

import arcgis
from arcgis.gis import GIS

gis = GIS()

search_result = gis.content.search(query="orgid: Your org id here", max_items = 100)
for item in search_result:
    print(item.tags)

View solution in original post

3 Replies
MunachisoOgbuchiekwe
New Contributor III

Hello Aaron,

You can search by your organization id, then loop though all the items and print out the tags. Below is an example....

import arcgis
from arcgis.gis import GIS

gis = GIS()

search_result = gis.content.search(query="orgid: Your org id here", max_items = 100)
for item in search_result:
    print(item.tags)
AaronPaul5
New Contributor II

Hi Munachiso,

Thank you for the easy to follow code snippet.

I am now trying to use the same code for Portal.

Should it work in portal and why doesn't it need credentials to get the tags?

Thank you again,

Aaron

0 Kudos
BertramGilfoyle
New Contributor

this string is not working for me. does anyone have an update?

0 Kudos