PROBLEM

Items disappear from groups after overwriting a feature layer or service using ArcGIS API for Python

Last Published: October 8, 2020

Description

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.

Cause

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.

Solution or Workaround

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

Software:
  • ArcGIS REST API
  • ArcGIS Online
  • Portal for ArcGIS
  • ArcGIS API for Python

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options