<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Batch Update Data Source in Pro Map - python/CIM in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/batch-update-data-source-in-pro-map-python-cim/m-p/1243473#M63735</link>
    <description>&lt;P&gt;Looks like&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_self"&gt; update connection properties&lt;/A&gt; will do that for you.&lt;/P&gt;&lt;P&gt;I'd start with the first example under "Using the connectionProperties dictionary".&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2022 22:46:21 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2022-12-22T22:46:21Z</dc:date>
    <item>
      <title>Batch Update Data Source in Pro Map - python/CIM</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/batch-update-data-source-in-pro-map-python-cim/m-p/1243405#M63718</link>
      <description>&lt;P&gt;I recall unsuccessfully traversing this topic a couple months ago (did not post here though).&amp;nbsp; Simple question.&amp;nbsp; I have multiple layers in an ArcGIS Pro map.&amp;nbsp; I have created an updated feature class WITHIN the same gdb, but with a different name.&amp;nbsp; Currently I have 15 layers utilizing the same data source path/to/zachs.gdb/fc_name to&amp;nbsp;path/to/zachs.gdb/fc_name&lt;STRONG&gt;_v2&lt;/STRONG&gt;.&amp;nbsp; &lt;EM&gt;note that the 15 layers have definition queries for 15 different value.&amp;nbsp;&lt;/EM&gt;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/&amp;lt;dataset&amp;gt;.&lt;/P&gt;&lt;P&gt;BELOW code adapted from here (&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm&lt;/A&gt;) BUT there are no methods or properties in the CIM or elsewhere to update my FCs if it's just a name change.&amp;nbsp; &lt;STRONG&gt;Ideas?&amp;nbsp;&lt;/STRONG&gt;Can be with CIM or any module...&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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.workspaceConnectionString&lt;/LI-CODE&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;P&gt;Zach&lt;/P&gt;&lt;P&gt;Pro V. 3.0.02&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 18:45:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/batch-update-data-source-in-pro-map-python-cim/m-p/1243405#M63718</guid>
      <dc:creator>ZacharyUhlmann1</dc:creator>
      <dc:date>2022-12-22T18:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Update Data Source in Pro Map - python/CIM</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/batch-update-data-source-in-pro-map-python-cim/m-p/1243473#M63735</link>
      <description>&lt;P&gt;Looks like&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_self"&gt; update connection properties&lt;/A&gt; will do that for you.&lt;/P&gt;&lt;P&gt;I'd start with the first example under "Using the connectionProperties dictionary".&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 22:46:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/batch-update-data-source-in-pro-map-python-cim/m-p/1243473#M63735</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-12-22T22:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Update Data Source in Pro Map - python/CIM</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/batch-update-data-source-in-pro-map-python-cim/m-p/1243476#M63736</link>
      <description>&lt;P&gt;You are 100% correct.&amp;nbsp; I always confuse database and dataSET.&amp;nbsp; Took me some fumbline, but eventually...Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/15530"&gt;@RhettZufelt&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Update the Feature Classe(FC) source in TOC via the CIM
# In this example, multiple Layers nested in Group Layer, all same source, 
# with Def Queries to make different.
import copy
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('map_name')[0]
# Get Layer Group from TOC containing the species layer
spp_group = m.listLayers('spp')[0]
# Now get list of all layers
spp_lyrs = spp_group.listLayers()
# loop through and update layer source FC to species_v2
for spp in spp_lyrs:
    cp = spp.connectionProperties
    cp['dataset']='species_v2'
    spp.updateConnectionProperties(spp.connectionProperties, cp)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 22:59:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/batch-update-data-source-in-pro-map-python-cim/m-p/1243476#M63736</guid>
      <dc:creator>ZacharyUhlmann1</dc:creator>
      <dc:date>2022-12-22T22:59:49Z</dc:date>
    </item>
  </channel>
</rss>

