Select to view content in your preferred language

Programmatically get a list of all organization survey owners

211
1
Jump to solution
10-31-2024 08:39 AM
Jay_Gregory
Frequent Contributor

I'm curious if anyone has a strategy to programmatically (search API, Python, etc.) get a list of all survey items in an organization (and hence all survey owners as well). 

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

When you search your content, use item_type='form'

from arcgis import GIS

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

surveys = gis.content.search(
    '',
    item_type= 'form',
    max_items= -1
)

for s in surveys:
    print(f'{s.owner:16} | {s.id:32} | {s.title}')

jcarlson_0-1730392342807.png

 

- Josh Carlson
Kendall County GIS

View solution in original post

1 Reply
jcarlson
MVP Esteemed Contributor

When you search your content, use item_type='form'

from arcgis import GIS

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

surveys = gis.content.search(
    '',
    item_type= 'form',
    max_items= -1
)

for s in surveys:
    print(f'{s.owner:16} | {s.id:32} | {s.title}')

jcarlson_0-1730392342807.png

 

- Josh Carlson
Kendall County GIS