Greetings,
The script query returns items from Portal, the query doesn't recognise Item_Type??
The aim is to return a Feature Collection and associated Layers, this might be 1 or might be 10. I find it odd that I would have to use an IF loop to return the Feature Type
all_users = portal.users.search(max_users = 700) # The default of max_users = 100
#groups = portal.groups.search(query='owner:*', max_groups=50)
#groups = portal.content.search(query='owner:*', item_type='Feature*')
groups = portal.groups.search('title:*', max_groups=50)
## output file
outFile = (r"C:\Users\users\Documents\local\Programme\GIS Data Catalogue\GIS_Items.csv")
with open(outFile, 'w') as csvfile:
filewriter = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
filewriter.writerow(['group_id', 'group_title', 'group_owner', 'item_id', 'item_title', 'item_type', 'item_owner'])
for group in groups:
# ### Prints the Group Name + Owner
# #print(group.title, group.owner)
for user in all_users:
#print(group.id, group.title, group.owner)
#### List the Items in Portal
content_item = user.items()
for item in content_item:
#print(group.id, group.title, group.owner, item.id, item.title, item.owner)
rowitem = (group.id, group.title, group.owner, item.id, item.title, item.type, item.owner)
filewriter.writerow(rowitem )
## outFile.close
print("END")
Appreciate any pointers.
Regards,
Clive