Can You Download A Spreadsheet List Of All Items in Portal?

1093
5
Jump to solution
07-29-2021 01:42 PM
Labels (2)
DavidMieksztyn
New Contributor III

I am interested in conducting an inventory of all our content items in Portal in an effort to clean up content. Is there a way to download a spreadsheet listing all content found in our organization?

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

What version are you on? You can go into Organization → Status → Reports to create an Item report with details about all content, but I believe that was added in 10.9.

jcarlson_0-1627592688320.png

 

- Josh Carlson
Kendall County GIS

View solution in original post

5 Replies
jcarlson
MVP Esteemed Contributor

What version are you on? You can go into Organization → Status → Reports to create an Item report with details about all content, but I believe that was added in 10.9.

jcarlson_0-1627592688320.png

 

- Josh Carlson
Kendall County GIS
DavidMieksztyn
New Contributor III

Thanks Josh, we are running 10.8 still. This is good to know though when we upgrade!

0 Kudos
jcarlson
MVP Esteemed Contributor

You could still get a similar list via Python, too. I have an old code snippet I used to use back on 10.8 that I could dig up if you're interested.

- Josh Carlson
Kendall County GIS
0 Kudos
DavidMieksztyn
New Contributor III

Hi Josh, I would be interested in that actually, based on the timing of our inventory and when we'll be upgrading to 10.9 later. Thanks! 

0 Kudos
jcarlson
MVP Esteemed Contributor

 

from arcgis import GIS
import pandas as pd

gis = GIS('portal url', 'user', 'password')

content_list = gis.content.search('NOT owner:esri_apps', max_items=-1)

out_dict = {}

for item in content_list:

    out_dict[content_list.index(item)] = [item.title, item.type, item.numViews, item.owner, item.id]

df = pd.DataFrame.from_dict(out_dict, orient='index')

df.rename(columns={0:'title', 1:'type', 2:'views', 3:'owner', 4:'id'}, inplace=True)

df.to_csv('your-report-name.csv')

 

That oughta do it. You can pretty easily alter this to include additional properties in the output, but this is a start.

- Josh Carlson
Kendall County GIS