BRANCH versioned feature service version change using arcpy

08-18-2022 04:58 AM
New Contributor II

Hi All,

We are using BRANCH versioned feature service to perform editing's in ArcGIS Pro 3.0.

After completing the edits, requirement is to change the added feature service in TOC from 'child version' to 'SDE.DEFAULT' version using arcpy

Python code we are trying to use:

import arcpy

aprx ="C:\abc_Pro\Project\abc_Aprx.aprx")

m = aprx.listMaps('Map')[0]

for lyr in m.listLayers():
if ( == "APPROVED"):, "BRANCH", "sde.DEFAULT", None, "INCLUDE")

When we run the above script in "Python Notebook" in ArcGIS Pro, it is working fine.

When we run the same from python script (ex:, script executing with out errors but services are not changing to "DEFAULT" version.

Anything we are missing in this. Appreciate help on this. Thanks.



0 Kudos
0 Replies