<?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>idea Improved documentation for updateConnectionProperties(): workspace_factory in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idi-p/1271494</link>
    <description>&lt;P&gt;Please see&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/determining-workspace-type-arcmap/m-p/1271278" target="_blank" rel="noopener"&gt;this post&lt;/A&gt;&amp;nbsp;for more details.&lt;/P&gt;&lt;P&gt;For context, I've been trying to write some code to mass-replace data sources. However, Pro's only way to do this, updateConnectionProperties(), requires you to know not just the file path, but what type of file and workspace it belongs to. *&lt;/P&gt;&lt;P&gt;This would be fine except there's no documentation for acceptable values, nor is there an easy way to find out, short of loading all of your files and checking their connection properties yourself.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;What I am looking for is an exhaustive list of possible values for the workspace_factory parameter&lt;/U&gt;&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are places I have checked:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank" rel="noopener"&gt;Updating and fixing data sources—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm" target="_blank" rel="noopener"&gt;Layer—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_blank" rel="noopener"&gt;ArcGISProject—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/describe-object-properties.htm" target="_blank" rel="noopener"&gt;Describe object properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/layer-properties.htm" target="_blank" rel="noopener"&gt;Layer properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/workspace-properties.htm" target="_blank" rel="noopener"&gt;Workspace properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/defining-parameter-data-types-in-a-python-toolbox.htm" target="_blank" rel="noopener"&gt;Parameter data types in a Python toolbox—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#WorkspaceFactory.htm" target="_blank" rel="noopener"&gt;WorkspaceFactory Class (ArcObjects .NET 10.8 SDK) (arcgis.com)&lt;/A&gt;&amp;nbsp;(ArcMap)&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://developers.arcgis.com/enterprise-sdk/api-reference/net/IWorkspaceFactory/" target="_blank" rel="noopener"&gt;IWorkspaceFactory Interface | ArcGIS Enterprise SDK&lt;/A&gt;&amp;nbsp;(Pro)&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm" target="_blank" rel="noopener"&gt;layer.replaceDataSource()&lt;/A&gt; (ArcMap)&lt;/LI&gt;&lt;LI&gt;Just about every python file in the arcpy folder.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;At the end of all of this, I still don't have any idea of what my possible options are.&lt;/P&gt;&lt;P&gt;Improved documentation would be a lifesaver, considering updateConnectionProperties() already asks you do a lot of the thinking that it should be doing for you (Meaning it should be able to figure out if you’re feeding it a shapefile or not without you telling it).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Please update the documentation somewhere&lt;/U&gt;&lt;/STRONG&gt;, be it at &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank" rel="noopener"&gt;Updating and fixing data sources—ArcGIS Pro |&amp;nbsp; Documentation&lt;/A&gt;&amp;nbsp;or&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm" target="_blank" rel="noopener"&gt;Layer—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_blank" rel="noopener"&gt;ArcGISProject—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Detailed documentation of my search:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;1.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank" rel="noopener"&gt;Updating and fixing data sources—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;only gives the example of “File Geodatabase”, but it is far from exhaustive.&lt;BR /&gt;&lt;BR /&gt;2.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm" target="_blank" rel="noopener"&gt;Layer—ArcGIS Pro | Documentation&lt;/A&gt;&lt;SPAN&gt; Looking at the connectionProperties, didn’t go anywhere, due to the lack of a comprehensive list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_0-1679683024396.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66225i0A33E47E43CB37FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_0-1679683024396.png" alt="AlfredBaldenweck_0-1679683024396.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_blank" rel="noopener"&gt;ArcGISProject—ArcGIS Pro | Documentation&lt;/A&gt; See #2, Layer&lt;BR /&gt;&lt;BR /&gt;4.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/describe-object-properties.htm" target="_blank" rel="noopener"&gt;Describe object properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;SPAN&gt; Nothing helpful in the basic properties, but put me onto Layer Properties (Describe).&lt;BR /&gt;&lt;BR /&gt;5.&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/layer-properties.htm" target="_blank" rel="noopener"&gt;Layer properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;SPAN&gt; I checked dataElementType and dataType. Neither are formatted correctly, so I would need to build a dictionary to match to the (missing) comprehensive list.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_1-1679683024398.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66227iF3DB26E6F78D0EC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_1-1679683024398.png" alt="AlfredBaldenweck_1-1679683024398.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;I thought I might be able to make a list by just describing every file in a directory, then returning the set, but surprise: any coverages will crash both Pro and ArcMap (To be clear, I'm not planning on using coverages, but we do have some and they're getting in the way of trying to get this list).&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_2-1679683024399.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66226iAD3B3D8A3E649D6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_2-1679683024399.png" alt="AlfredBaldenweck_2-1679683024399.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;This will crash Pro and ArcMap/Catalog when it reaches a coverage. Changing to arcpy.da.Describe() for Pro doesn’t help.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;6. &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/workspace-properties.htm" target="_blank" rel="noopener"&gt;Workspace properties—ArcGIS Pro | Documentation&lt;/A&gt; has a very small list of possible properties:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;esriDataSourcesGDB.AccessWorkspaceFactory.1—Personal geodatabase&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.FileGDBWorkspaceFactory.1—File geodatabase&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.InMemoryWorkspaceFactory.1—In-memory workspace&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.MemoryWorkspaceFactory.1—Memory workspace&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.SdeWorkspaceFactory.1—Enterprise geodatabase&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.SqliteWorkspaceFactory.1—Mobile geodatabase&lt;/LI&gt;&lt;LI&gt;(empty string)—Other&lt;/LI&gt;&lt;/UL&gt;&lt;P class="lia-indent-padding-left-30px"&gt;This list is not exhaustive; shapefiles and rasters would not return anything useful, despite having an entry in connectionProperties. Also, this list is not formatted in the way I need for use in updateConnectionProperties().&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;7.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/defining-parameter-data-types-in-a-python-toolbox.htm" target="_blank" rel="noopener"&gt;Parameter data types in a Python toolbox—ArcGIS Pro | Documentation&lt;/A&gt; See #4, Layer Properties, dataElementType&lt;BR /&gt;&lt;BR /&gt;8.&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#WorkspaceFactory.htm" target="_blank" rel="noopener"&gt;WorkspaceFactory Class (ArcObjects .NET 10.8 SDK) (arcgis.com)&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;(ArcMap)&amp;nbsp;provides a list but not with correct formatting.&lt;BR /&gt;&lt;BR /&gt;9.&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/enterprise-sdk/api-reference/net/IWorkspaceFactory/" target="_blank" rel="noopener"&gt;IWorkspaceFactory Interface | ArcGIS Enterprise SDK&lt;/A&gt;&amp;nbsp;(Pro)&amp;nbsp;provides a list but not with correct formatting.&lt;BR /&gt;&lt;BR /&gt;10.&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm" target="_blank" rel="noopener"&gt;replaceDataSource()&lt;/A&gt;&lt;SPAN&gt; (Arcmap) has a potentially useful list, although not formatted in a helpful way.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;ACCESS_WORKSPACE — A personal geodatabase or Access workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;ARCINFO_WORKSPACE — An ArcInfo coverage workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;CAD_WORKSPACE —A CAD file workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;EXCEL_WORKSPACE —An Excel file workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;FILEGDB_WORKSPACE —A file geodatabase workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;NONE —Used to skip the parameter&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;OLEDB_WORKSPACE —An OLE database workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;PCCOVERAGE_WORKSPACE —A PC ARC/INFO Coverage workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;RASTER_WORKSPACE —A raster workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;SDE_WORKSPACE —An SDE geodatabase workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;SHAPEFILE_WORKSPACE —A shapefile workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;TEXT_WORKSPACE —A text file workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;TIN_WORKSPACE —A TIN workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;VPF_WORKSPACE —A VPF workspace&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;11. I checked _mp, arcobjects (every file), anything to do with toolboxes. Nothing.&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;*To be clear, depending on your use case, you may need less. In my case, where I'm frequently changing not just the GDB or folder, but also changing to a file with a different name, I do need this information. See "Changing a layer's dataset" &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 19:33:39 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2023-04-06T19:33:39Z</dc:date>
    <item>
      <title>Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idi-p/1271494</link>
      <description>&lt;P&gt;Please see&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/determining-workspace-type-arcmap/m-p/1271278" target="_blank" rel="noopener"&gt;this post&lt;/A&gt;&amp;nbsp;for more details.&lt;/P&gt;&lt;P&gt;For context, I've been trying to write some code to mass-replace data sources. However, Pro's only way to do this, updateConnectionProperties(), requires you to know not just the file path, but what type of file and workspace it belongs to. *&lt;/P&gt;&lt;P&gt;This would be fine except there's no documentation for acceptable values, nor is there an easy way to find out, short of loading all of your files and checking their connection properties yourself.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;What I am looking for is an exhaustive list of possible values for the workspace_factory parameter&lt;/U&gt;&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are places I have checked:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank" rel="noopener"&gt;Updating and fixing data sources—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm" target="_blank" rel="noopener"&gt;Layer—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_blank" rel="noopener"&gt;ArcGISProject—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/describe-object-properties.htm" target="_blank" rel="noopener"&gt;Describe object properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/layer-properties.htm" target="_blank" rel="noopener"&gt;Layer properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/workspace-properties.htm" target="_blank" rel="noopener"&gt;Workspace properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/defining-parameter-data-types-in-a-python-toolbox.htm" target="_blank" rel="noopener"&gt;Parameter data types in a Python toolbox—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#WorkspaceFactory.htm" target="_blank" rel="noopener"&gt;WorkspaceFactory Class (ArcObjects .NET 10.8 SDK) (arcgis.com)&lt;/A&gt;&amp;nbsp;(ArcMap)&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://developers.arcgis.com/enterprise-sdk/api-reference/net/IWorkspaceFactory/" target="_blank" rel="noopener"&gt;IWorkspaceFactory Interface | ArcGIS Enterprise SDK&lt;/A&gt;&amp;nbsp;(Pro)&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm" target="_blank" rel="noopener"&gt;layer.replaceDataSource()&lt;/A&gt; (ArcMap)&lt;/LI&gt;&lt;LI&gt;Just about every python file in the arcpy folder.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;At the end of all of this, I still don't have any idea of what my possible options are.&lt;/P&gt;&lt;P&gt;Improved documentation would be a lifesaver, considering updateConnectionProperties() already asks you do a lot of the thinking that it should be doing for you (Meaning it should be able to figure out if you’re feeding it a shapefile or not without you telling it).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Please update the documentation somewhere&lt;/U&gt;&lt;/STRONG&gt;, be it at &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank" rel="noopener"&gt;Updating and fixing data sources—ArcGIS Pro |&amp;nbsp; Documentation&lt;/A&gt;&amp;nbsp;or&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm" target="_blank" rel="noopener"&gt;Layer—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_blank" rel="noopener"&gt;ArcGISProject—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Detailed documentation of my search:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;1.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank" rel="noopener"&gt;Updating and fixing data sources—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;only gives the example of “File Geodatabase”, but it is far from exhaustive.&lt;BR /&gt;&lt;BR /&gt;2.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm" target="_blank" rel="noopener"&gt;Layer—ArcGIS Pro | Documentation&lt;/A&gt;&lt;SPAN&gt; Looking at the connectionProperties, didn’t go anywhere, due to the lack of a comprehensive list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_0-1679683024396.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66225i0A33E47E43CB37FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_0-1679683024396.png" alt="AlfredBaldenweck_0-1679683024396.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm" target="_blank" rel="noopener"&gt;ArcGISProject—ArcGIS Pro | Documentation&lt;/A&gt; See #2, Layer&lt;BR /&gt;&lt;BR /&gt;4.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/describe-object-properties.htm" target="_blank" rel="noopener"&gt;Describe object properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;SPAN&gt; Nothing helpful in the basic properties, but put me onto Layer Properties (Describe).&lt;BR /&gt;&lt;BR /&gt;5.&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/layer-properties.htm" target="_blank" rel="noopener"&gt;Layer properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;SPAN&gt; I checked dataElementType and dataType. Neither are formatted correctly, so I would need to build a dictionary to match to the (missing) comprehensive list.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_1-1679683024398.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66227iF3DB26E6F78D0EC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_1-1679683024398.png" alt="AlfredBaldenweck_1-1679683024398.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;I thought I might be able to make a list by just describing every file in a directory, then returning the set, but surprise: any coverages will crash both Pro and ArcMap (To be clear, I'm not planning on using coverages, but we do have some and they're getting in the way of trying to get this list).&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_2-1679683024399.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66226iAD3B3D8A3E649D6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_2-1679683024399.png" alt="AlfredBaldenweck_2-1679683024399.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;This will crash Pro and ArcMap/Catalog when it reaches a coverage. Changing to arcpy.da.Describe() for Pro doesn’t help.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;6. &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/workspace-properties.htm" target="_blank" rel="noopener"&gt;Workspace properties—ArcGIS Pro | Documentation&lt;/A&gt; has a very small list of possible properties:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;esriDataSourcesGDB.AccessWorkspaceFactory.1—Personal geodatabase&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.FileGDBWorkspaceFactory.1—File geodatabase&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.InMemoryWorkspaceFactory.1—In-memory workspace&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.MemoryWorkspaceFactory.1—Memory workspace&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.SdeWorkspaceFactory.1—Enterprise geodatabase&lt;/LI&gt;&lt;LI&gt;esriDataSourcesGDB.SqliteWorkspaceFactory.1—Mobile geodatabase&lt;/LI&gt;&lt;LI&gt;(empty string)—Other&lt;/LI&gt;&lt;/UL&gt;&lt;P class="lia-indent-padding-left-30px"&gt;This list is not exhaustive; shapefiles and rasters would not return anything useful, despite having an entry in connectionProperties. Also, this list is not formatted in the way I need for use in updateConnectionProperties().&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;7.&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/defining-parameter-data-types-in-a-python-toolbox.htm" target="_blank" rel="noopener"&gt;Parameter data types in a Python toolbox—ArcGIS Pro | Documentation&lt;/A&gt; See #4, Layer Properties, dataElementType&lt;BR /&gt;&lt;BR /&gt;8.&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#WorkspaceFactory.htm" target="_blank" rel="noopener"&gt;WorkspaceFactory Class (ArcObjects .NET 10.8 SDK) (arcgis.com)&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;(ArcMap)&amp;nbsp;provides a list but not with correct formatting.&lt;BR /&gt;&lt;BR /&gt;9.&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/enterprise-sdk/api-reference/net/IWorkspaceFactory/" target="_blank" rel="noopener"&gt;IWorkspaceFactory Interface | ArcGIS Enterprise SDK&lt;/A&gt;&amp;nbsp;(Pro)&amp;nbsp;provides a list but not with correct formatting.&lt;BR /&gt;&lt;BR /&gt;10.&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm" target="_blank" rel="noopener"&gt;replaceDataSource()&lt;/A&gt;&lt;SPAN&gt; (Arcmap) has a potentially useful list, although not formatted in a helpful way.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;ACCESS_WORKSPACE — A personal geodatabase or Access workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;ARCINFO_WORKSPACE — An ArcInfo coverage workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;CAD_WORKSPACE —A CAD file workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;EXCEL_WORKSPACE —An Excel file workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;FILEGDB_WORKSPACE —A file geodatabase workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;NONE —Used to skip the parameter&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;OLEDB_WORKSPACE —An OLE database workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;PCCOVERAGE_WORKSPACE —A PC ARC/INFO Coverage workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;RASTER_WORKSPACE —A raster workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;SDE_WORKSPACE —An SDE geodatabase workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;SHAPEFILE_WORKSPACE —A shapefile workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;TEXT_WORKSPACE —A text file workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;TIN_WORKSPACE —A TIN workspace&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;VPF_WORKSPACE —A VPF workspace&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;11. I checked _mp, arcobjects (every file), anything to do with toolboxes. Nothing.&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;*To be clear, depending on your use case, you may need less. In my case, where I'm frequently changing not just the GDB or folder, but also changing to a file with a different name, I do need this information. See "Changing a layer's dataset" &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 19:33:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idi-p/1271494</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-04-06T19:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1277074#M24363</link>
      <description>&lt;P&gt;Alfred,&lt;/P&gt;&lt;P&gt;There are a few new things in the 3.1 &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_self"&gt;Updating Data Sources&lt;/A&gt; help that might help with this.&lt;/P&gt;&lt;P&gt;1.) In the first batch of samples, look at sample #6. New at 3.1, you dont need to know anything about the source of the existing layer. You can supply None in the first parameter. E.g.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx.updateConnectionProperties(None, r'C:\Projects\YosemiteNP\New_Data\Yosemite.gdb')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.) Check out the sub sections entitled&amp;nbsp;&lt;EM&gt;Updating data sources via the CIM&lt;/EM&gt; and &lt;EM&gt;Changing a layer's dataset.&amp;nbsp;&lt;/EM&gt;Changing a layer's dataset via the CIM might be easier than using the ConnectionProperties dictionary in your case. Those aforementioned sections might be more in line with what you are trying to accomplish. There is a trail of breadcrumbs that will lead you to a list of the workspace factory values. (But I admit that it's not the easiest thing to find. I will investigate a way to make this easier in the future.)&amp;nbsp; If you follow the link to the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_self"&gt;Python CIM Access&lt;/A&gt; topic, then to the &lt;A href="https://github.com/esri/cim-spec" target="_self"&gt;CIM Spec&lt;/A&gt;, they are listed in the CIM spec &lt;A href="https://github.com/Esri/cim-spec/blob/main/docs/v3/CIMVectorLayers.md#cimworkspaceconnection" target="_self"&gt;here&lt;/A&gt;. Search for&amp;nbsp;&lt;EM&gt;WorkspaceFactory&lt;/EM&gt; on that page.&lt;/P&gt;&lt;H4&gt;Workspace factory types.&lt;/H4&gt;&lt;P&gt;Property Value Description&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;SDE&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Enterprise geodatabase.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;FileGDB&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;File geodatabase.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Raster&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Raster.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Shapefile&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Shapefile.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;OLEDB&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;OLEDB.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Access&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;Microsoft Access.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DelimitedTextFile&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;Delimited text file.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Custom&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;Custom.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sql&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;SQL query layer.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Tin&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;TIN.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TrackingServer&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;Tracking server.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NetCDF&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;NetCDF.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;LASDataset&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;LAS dataset.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SQLite&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;SQLite.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;FeatureService&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;Feature service.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ArcInfo&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;Arc/INFO Coverage.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Cad&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;CAD.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Excel&lt;/TD&gt;&lt;TD&gt;17&lt;/TD&gt;&lt;TD&gt;Microsoft Excel.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WFS&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;Web feature service.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;StreamService&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;Stream service&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BIMFile&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;BIM file.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;InMemoryDB&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;In memory database.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NoSQL&lt;/TD&gt;&lt;TD&gt;22&lt;/TD&gt;&lt;TD&gt;NoSQL.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BigDataConnection&lt;/TD&gt;&lt;TD&gt;23&lt;/TD&gt;&lt;TD&gt;Big Data connection.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;KnowledgeGraph&lt;/TD&gt;&lt;TD&gt;24&lt;/TD&gt;&lt;TD&gt;Knowledge Graph connection.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NITF&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;NITF connection.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 20:40:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1277074#M24363</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2023-04-10T20:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1277954#M24416</link>
      <description>&lt;P&gt;Hi Jeff, thanks for the response.&lt;/P&gt;&lt;P&gt;To your first point, it doesn't matter at all what the existing source is, all that matters is what you're trying to replace it with. (As an aside:&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;really&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;,&lt;/EM&gt; UpdateConnectionProperties() should be able to just figure this stuff out. If Pro can do it when you go through GUI, it should be able to do it through Python)&lt;/P&gt;&lt;P&gt;I gave the CIM properties a shot, and ultimately, they haven't worked out. 1) They still require you to know what kind of file it is that you're replacing with and 2) I can change the layer source just fine by updating CIM, but if I save and come back, it's broken and the source is now the name of the project folder plus the source I tried changing it to. I would say this is user error except for it works fine in the session so&lt;SPAN&gt;&amp;nbsp;¯\_ (ツ)_/¯.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_0-1681324376072.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67799iDFBF829B8EC695FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_0-1681324376072.png" alt="AlfredBaldenweck_0-1681324376072.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(Also this set up will crash Pro if you try to manually replace the sources and it looks like this.)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;More importantly, the list that you give (which is comprehensive and great for CIM stuff) is formatted differently from the acceptable values in updateConnectionProperties(). For example, acceptable values there are "Shape File" and "File Geodatabase", not "Shapefile" and "FileGDB". Using either of the latter values doesn't do anything. Like, not even an error. It just skips by.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 19:06:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1277954#M24416</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-04-12T19:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1278250#M24438</link>
      <description>&lt;P&gt;Can you show me your code? For the shapefile example, are you re-sourcing something like, c:\data1\shapefile1.shp to c:\data2\shapefile2.shp?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 13:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1278250#M24438</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2023-04-13T13:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1278285#M24441</link>
      <description>&lt;P&gt;Of course, thank you.&lt;/P&gt;&lt;P&gt;Below is my CIM code. I've just been dropping it into the Python window to test. (I'm stuck in 2.9 for now)&lt;/P&gt;&lt;P&gt;For testing, I'm using a blank shapefile (No records, nothing) and a similarly blank file geodatabase feature class, trying to switch the layer's reference between them.&amp;nbsp;&lt;BR /&gt;I have the full range of acceptable values in wkspfactList, but this error behaviour also occurs if that list of values is just ["FileGDB", "Shapefile"].&lt;/P&gt;&lt;P&gt;Again, it works great as long as the Project is open and falls apart once you exit.&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')
mp = aprx.activeMap
lays = mp.listLayers()

sourceDict = {r"W:\Downloads\testmdb\test.gdb\ex1gdb": r"W:\Downloads\testmdb\example1.shp",
              r"W:\Downloads\testmdb\example1.shp": r"W:\Downloads\testmdb\test.gdb\ex1gdb"}
              
''' Update CIM workflow'''
wkspfactList = ["SDE", "FileGDB", "Raster", "Shapefile", "OLEDB",
                "Access", "DelimitedTextFile", "Custom", "Sql",
                "Tin", "TrackingServer", "NetCDF", "LASDataset",
                "SQLite", "FeatureService", "ArcInfo", "Cad", 
                "Excel", "WFS", "StreamService", "BIMFile", 
                "InMemoryDB", "NoSQL", "BigDataConnection",
                "KnowledgeGraph", "NITF"]
for lay in lays:
    if lay.isGroupLayer:
        continue
    # If anyone can tell me why sometimes layers support
    #    dataSource and sometimes they don't; that'd be awesome.  
    # Ditto for catalogPath.  
    if lay.supports("dataSource"):
        layPath = lay.dataSource
    else:
        layPath= arcpy.da.Describe(lay)["catalogPath"]
        
    if layPath in sourceDict:
        descR= arcpy.da.Describe(sourceDict[layPath])
        for wkspc in wkspfactList:
            # Get the layer's CIM definition
            layCIM = lay.getDefinition('V2')

            # Create a new CIM data connection
            dc = arcpy.cim.CreateCIMObjectFromClassName('CIMStandardDataConnection', 'V2')
            # Specify the geodatabase
            dc.workspaceConnectionString = f"DATABASE= {descR['path']}"
            
            # Specify the workspace type
            dc.workspaceFactory = wkspc

            # Specify the dataset name
            dc.dataset = descR['name']

            # Set the new data connection to the layer's CIM featureTable
            layCIM.featureTable.dataConnection = dc
                
            # Set the layer's CIM definition
            lay.setDefinition(layCIM)
            
            # Stop if you have something that works.
            if lay.isBroken:
                continue
            else:
                break​&lt;/LI-CODE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;For updateConnectionProperties:&lt;BR /&gt;This works great except for I don't know the acceptable values nor how to guess them.&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('CURRENT')
mp = aprx.activeMap
lays = mp.listLayers()

sourceDict = {r"W:\Downloads\testmdb\test.gdb\ex1gdb": r"W:\Downloads\testmdb\example1.shp",
              r"W:\Downloads\testmdb\example1.shp": r"W:\Downloads\testmdb\test.gdb\ex1gdb"}

''' updateConnectionProperties workflow'''
wkspfactDict = {"DEFeatureClass": "File Geodatabase",
                "DEShapeFile": "Shape File"}
for lay in lays:
    if lay.isGroupLayer:
        continue
    # If anyone can tell me why some layers don't support dataSource
    #   that'd be great.
    if lay.supports("dataSource"):
        layPath = lay.dataSource
    else:
        layPath= arcpy.da.Describe(lay)["catalogPath"]
    if layPath in sourceDict:
        descR= arcpy.da.Describe(sourceDict[layPath])
        layCP = lay.connectionProperties
        fCP = {'dataset': descR["name"], 
               'workspace_factory': wkspfactDict[descR["dataElementType"]],
               'connection_info': 
              {'database': descR["path"]}
        }
        lay.updateConnectionProperties(layCP, fCP )
print("done")     &lt;/LI-CODE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;I hate to say it, but this entire thing was a lot easier in ArcMap; you made a list, looped until something didn't break, and there you go. Having to make an educated guess is a lot more trouble, especially since Pro apparently will just change stuff to whatever you say instead of breaking if it doesn't work.&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;LI-CODE lang="python"&gt;def replaceDS27(sourcemap, sourcedict):
    sourcemap = arcpy.mapping.MapDocument(sourcemap)
    #for lay in arcpy.mapping.ListBrokenDataSources(sourcemap):
    for lay in arcpy.mapping.ListLayers(sourcemap):
        layDS= lay.dataSource
        if layDS in sourcedict:
            layD= sourcedict[layDS]
            dirN= os.path.dirname(layD)
            baseN= os.path.splitext(os.path.basename(layD))[0]
            wkspcType = ['ACCESS_WORKSPACE',
                         'ARCINFO_WORKSPACE',
                         'CAD_WORKSPACE',
                         'EXCEL_WORKSPACE',
                         'FILEGDB_WORKSPACE',
                         'NONE',
                         'OLEDB_WORKSPACE',
                         'PCCOVERAGE_WORKSPACE',
                         'RASTER_WORKSPACE',
                         'SDE_WORKSPACE',
                         'SHAPEFILE_WORKSPACE',
                         'TEXT_WORKSPACE',
                         'TIN_WORKSPACE',
                         'VPF_WORKSPACE'
                         ]
            # Attempt to replace the source by guessing the wkspc type.
            # Really we're just brute-forcing it rather than making
            #   an educated guess.
            for wkspc in wkspcType:
                try:
                    lay.replaceDataSource(dirN, wkspc, baseN)
                    break
                except:
                    continue
                        
    sourcemap.save()&lt;/LI-CODE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;STRONG&gt;I think in addition to a proper list of acceptable types of workspace factory; some sort of documentation showing how to programmatically find what types you have would be nice&lt;/STRONG&gt;, to avoid the "Throw against the wall and see what sticks" operation I've been running.* What I did for ArcMap works great but is pretty inefficient.&lt;/P&gt;&lt;P&gt;I've made an attempt to do this in the updateConnectionProperties() example by checking the dataElementType, but I'm not sure how viable that is outside of shapefiles and file gdb feature classes.&lt;/P&gt;&lt;P&gt;* The obvious question is "Why don't you know what types of data you have?" and the answer is I'm trying to do this for thousands of files, and it's easier to have the computer figure it out than it is for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:50:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1278285#M24441</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-04-13T14:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1281480#M24626</link>
      <description>&lt;P&gt;Alfred,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try a basic workflow first, and see if you can get it to work. Here is a sample using the CIM:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

aprx = arcpy.mp.ArcGISProject("C:\\Temp\\Shp2FGDB.aprx")
m = aprx.listMaps('SHP')[0]
lyr = m.listLayers('ShpStates')[0]
lyrCIM = lyr.getDefinition("V3")
lyrCIM.featureTable.dataConnection.workspaceConnectionString = "DATABASE=C:\\Temp\\States.gdb"
lyrCIM.featureTable.dataConnection.workspaceFactory = "FileGDB"
lyrCIM.featureTable.dataConnection.dataset = "States"
lyr.setDefinition(lyrCIM)
aprx.saveACopy("C:\\Temp\\Output.aprx")
print('done')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the same workflow using updateConnectionProperties and the connectionProperties dictionary.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

aprx = arcpy.mp.ArcGISProject("C:\\Temp\\Shp2FGDB.aprx")
m = aprx.listMaps('SHP')[0]
lyr = m.listLayers('ShpStates')[0]

find_dict = {'connection_info': {'database': 'C:\\Temp'},
 'dataset': 'ShpStates.shp',
 'workspace_factory': 'Shape File'}

replace_dict = {'connection_info': {'database': 'C:\\Temp\\States.gdb'},
 'dataset': 'States',
 'workspace_factory': 'File Geodatabase'}

lyr.updateConnectionProperties(find_dict, replace_dict)
aprx.saveACopy("C:\\Temp\\\Output.aprx")
print('done')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 21:02:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1281480#M24626</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2023-04-21T21:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1284455#M24794</link>
      <description>&lt;P&gt;Hi Jeff,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the CIM workflow you posted, changing only the necessary values (and the CIM version, since I'm in 2.9 for the foreseeable future.) The same thing happened with the new data source, and a colleague tested the same code with the same result.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_0-1682952992368.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69579i9060C3CA65283A1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlfredBaldenweck_0-1682952992368.png" alt="AlfredBaldenweck_0-1682952992368.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think I'm going to have to submit a support ticket for this specific issue.&lt;/P&gt;&lt;P&gt;That being said, I do want to reiterate the need for a&lt;U&gt; comprehensive list of acceptable values for updateConnectionProperties()&lt;/U&gt;, as well as a way to &lt;U&gt;programmatically determine which of those values is appropriate&lt;/U&gt; for your data.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 18:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1284455#M24794</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-05-01T18:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1284459#M24795</link>
      <description>&lt;P&gt;Is your File GDB feature class residing in a feature data set? If so, there might be another line you need to add to the CIM script.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 18:45:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1284459#M24795</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2023-05-01T18:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1284462#M24796</link>
      <description>&lt;P&gt;Nope, all out in the open. The shapefiles I've been testing with are in the same folder (testmdb) as well. I tested converting between the two gdb feature classes and converting between the two shapefiles, using version 2.9.5&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_1-1682967024622.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69606iB24042482D9A75A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlfredBaldenweck_1-1682967024622.png" alt="AlfredBaldenweck_1-1682967024622.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 18:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1284462#M24796</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-05-01T18:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1370752#M28045</link>
      <description>&lt;P&gt;I also need a comprehensive list of the workspace connection properties. I need to loop through folders containing lyrx files that are sourced from all different types of data. I need to print out the location of the data (ie if map service I need to print a URL, if raster I need to print the SDE properties, if shapefile I need to print folder and dataset name)&amp;nbsp; A comprehensive list of workspace connection properties could speed up my process infinitely.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 22:44:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1370752#M28045</guid>
      <dc:creator>mj_gis</dc:creator>
      <dc:date>2024-01-16T22:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory - Status changed to: Under Consideration</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1374205#M28163</link>
      <description />
      <pubDate>Wed, 24 Jan 2024 23:11:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1374205#M28163</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2024-01-24T23:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Improved documentation for updateConnectionProperties(): workspace_factory</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1622524#M35109</link>
      <description>&lt;P&gt;I also believe this would be a very important enhancement.&lt;/P&gt;&lt;P&gt;For a python toolbox I'm building, certain scripts need to consume .lyrx files distributed within the python package for the interactive feature parameter. The data connection posed an issue, since they referenced a FGDB on my machine, but at the same time, I don't want to create a feature class upon opening the tool just to load the .lyrx correctly.&lt;/P&gt;&lt;P&gt;Finally I was able to solve it by changing the data source connection to "InMemoryDB". I found out that the correct workspaceConnectionString for such case is&amp;nbsp;"INSTANCE_ID=GPProMemoryWorkspace". This isn't documented anywhere. (Though it wasn't hard to find out, I just created a FC in memory and checked the lyrx' JSON).&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 05:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/improved-documentation-for/idc-p/1622524#M35109</guid>
      <dc:creator>CSDING_GIS</dc:creator>
      <dc:date>2025-06-11T05:39:57Z</dc:date>
    </item>
  </channel>
</rss>

