laptop and a wrench

漏洞

When trying to update the data source of a layer from a file geodatabase to a feature service using ArcPy in ArcGIS Pro, specifically the l.updateConnectionProperties function, that data source is successfully updated on the back end, but it does not display in the Properties of the inputted layer.

ArcGIS Pro
漏洞 ID 编号 BUG-000176407
已提交May 13, 2025
上次修改时间June 25, 2025
适用范围ArcGIS Pro
找到的版本3.4
操作系统Windows OS
操作系统版本11.0 64 bit
状态Known Limit

附加信息

This is a workflow better suited to the Cartographic Information Model (CIM). For example, this will update the data source from geodatabase to feature service and the UI will properly update as well: aprx = arcpy.mp.ArcGISProject('CURRENT') m = aprx.listMaps('Map')[0] lyr = m.listLayers()[0] c = lyr.getDefinition('V3') dc = c.featureTable.dataConnection dc.workspaceConnectionString = "URL=https://services.arcgis.com/Wl7Y1m92PbjtJs5n/arcgis/rest/services/None/FeatureServer" dc.workspaceFactory = "FeatureService" dc.dataset = "0" lyr.setDefinition(c) Refer to these documentations: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#:~:text=%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ConPropsWithJoins(cp)-,Updating%20data%20sources%20using%20the%20CIM,-Starting%20with%20ArcGIS, https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#:~:text=Using%20the%20CIM%20to%20change%20a%20layer%27s%20dataset and https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm for more information.

解决办法

This is a workflow better suited to the Cartographic Information Model (CIM). For example, this will update the data source from geodatabase to feature service and the UI will properly update as well:

aprx = arcpy.mp.ArcGISProject('CURRENT')

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

lyr = m.listLayers()[0]

c = lyr.getDefinition('V3')

dc = c.featureTable.dataConnection

dc.workspaceConnectionString = "URL=https://services.arcgis.com/Wl7Y1m92PbjtJs5n/arcgis/rest/services/None/FeatureServer"

dc.workspaceFactory = "FeatureService"

dc.dataset = "0"

lyr.setDefinition(c)

重现步骤

漏洞 ID: BUG-000176407

软件:

  • ArcGIS Pro

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项