PROBLEM
In some cases, items may disappear from groups in Portal for ArcGIS or ArcGIS Online organizations after overwriting a feature layer or service using an ArcGIS API for Python script.
While it is possible to use ArcGIS API for Python to create automated updates for an item in a portal, the correct function must be used to ensure the sharing properties are defined properly.
Overwriting a feature layer or service using an ArcGIS API for Python script causes the item's sharing properties to revert to the default values. This is known behavior. If an incorrect function is used, the item's sharing properties must be defined manually with every update to ensure the item appears as it should in the portal.
To solve the issue, use the share() function to set the sharing properties to the desired value. Add the following to the script after the publishing call, where myItem is the variable assigned to the overwritten feature layer/service.
The following code snippet demonstrates an example of the script:
myGroup = <groupID> myItem.share(everyone = False, org = True, groups = myGroup)
Article ID: 000022544
Get help from ArcGIS experts
Download the Esri Support App