2

I'm trying to do some spring cleaning and in the plans of organizing and archiving older webmaps.

We have several hundred maps, so I'm looking for a way to create a simple CSV that will list all webmaps. With a CSV I will be able to track my progress better.

Does Portal have any way to do this?

Admin Tools for ArcGIS Online does this for AGOL, but not for free in portal.

0

1 Answer 1

2

To try this, you will need to adjust the variables in all caps at the beginning. This will also return all web mapping applications. If you only want web maps, remove the asterisk (which acts as a wildcard) from item_type="Web Map*". If you have trouble running this from your preferred IDE, just run it in the Python window within the ArcGIS Pro application.

from arcgis.gis import GIS
import pandas as pd
import os


PORTAL_URL = "PORTAL URL"
USERNAME = "USERNAME"
PASSWORD = "PASSWORD"
OUTPATH = "OUTPUT PATH"
OUTNAME = "OUTPUT NAME"
MAX_ITEMS_RETURNED = 1000

portal = GIS(PORTAL_URL, USERNAME, PASSWORD)
search_result = portal.content.search(query='owner:*', item_type="Web Map*",max_items = MAX_ITEMS_RETURNED)
pd.DataFrame(search_result).to_csv(os.path.join(OUTPATH,OUTNAME) + ".csv")

For more info visit https://developers.arcgis.com/python/guide/accessing-and-creating-content/

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.