ArcGIS Api for Python - set content status on Item

1219
2
12-17-2019 10:48 AM
DavidColey
Frequent Contributor

Hello - does anyone know how to set the content status on an item?  Currently, the api will allow you to read the content status property, but there seems to be no way to set the content status.  Something like:

portItem.update(item_properties={'content_status' : 'org_authoritative'})

would be ideal but 'content_status is not a property that can be set as part of item_properties, even as the json return does show content_status as contentStatus.  

0 Kudos
2 Replies
LorneDmitruk2
New Contributor III

Hi, 

All you have to do is the following:

portItem.content_status = 'authoritative'
DavidColey
Frequent Contributor

Thanks Lorne, yes that did it.  'org_authoritative' for portal.  I thought I tried that first thing, but sadly the api documentation isn't as intuitive as maybe it should be.  If interested, you can follow the content_status property setting with an Item.protect(enable=False) to remove delete protection, as I've been tripped up many times by having a layer set with delete protection . . .