Select to view content in your preferred language

Refresh Datasource arcpy command

3533
11
08-12-2024 01:32 PM
Status: Open
Labels (1)
Michele_Hosking
Regular Contributor

Please can we have an arcpy command to refresh data sources so changes made via a script run from within ArcGIS Pro updates the data shown in the project.

Needs to work in all circumstances, versioned (all types of versioning), non-versioned, enterprise geodatabase, file geodatabase.  And if versioned - working in a version or straight in the default table.

My situations are as follows:

In one case the feature layer is traditionally versioned but I'm working in the default version.  I would like to see changes made by me, in the default version via a script running from a toolbox using layers currently in the project.

In another case I have already programmatically created a version and changed to it in the project.  I am then making changes to layer in the project in that version via a script, from a toolbox. I need the changes to show in the project otherwise scripts that follow on in the process don't work as they are looking for data - that is there - in the data source - but ArcPro does not acknowledge that it is - until the following is manually done:

Michele_Hosking_2-1721162944992.png

This is related to (but apparently is not the same as) this idea: ArcPy RefreshCatalog() function for ArcGIS Pro (esri.com)

Also RefreshLayer() does not work on versioned data so this is not a solution.

11 Comments
OliviaMorris1

I have gone through our organization's ESRI's contacts (Technical Solution Engineer) to try to come up with a solution for this and none of the solutions worked to resolve the issue.