I recall unsuccessfully traversing this topic a couple months ago (did not post here though). Simple question. I have multiple layers in an ArcGIS Pro map. I have created an updated feature class WITHIN the same gdb, but with a different name. Currently I have 15 layers utilizing the same data source path/to/zachs.gdb/fc_name to path/to/zachs.gdb/fc_name_v2. note that the 15 layers have definition queries for 15 different value. I have found the documentation on how to use the cim to change the dataset or gdb underlying the source, but NOT if there is simply a different FC in the same path/to/gdb/<dataset>.
BELOW code adapted from here (https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm) BUT there are no methods or properties in the CIM or elsewhere to update my FCs if it's just a name change. Ideas? Can be with CIM or any module...
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('zachs_map')[0]
l = m.listLayers('group_w_15_layers')[0]
layer1 = l.listLayers()[1]
layer1_cim = human.getDefinition('V2')
dc = layer1_cim.featureTable.dataConnection
dc.workspaceConnectionStringthanks!
Zach
Pro V. 3.0.02