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:
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.
Hello,
there seems to be an alternative using python.Net : https://community.esri.com/t5/python-questions/refresh-data-after-python-tool-execution/td-p/173774
But I agree that a true arcpy function would be really helpful for GPtools or Toolboxes that update features.
I am having this same issue. I have a python script that does joins to a feature class that the user has in the map. The feature class is registered as Traditionally Versioned. I have found no successful way to refresh the layer in the user's map view other than the user manually right clicking on the database and refreshing it in their map. arcpy.RefreshLayer() does not work on versioned data. The old ArcMap version of our toolbox used the RefreshCatalog() function. We really need the equivalent of a RefreshDataSource or something in ArcGIS Pro to get the same functionality.
Any news regarding this feature? Did you guys find a way to refresh the content of your Enterprise Geodatabases to continue a process that requires the database to be refreshed?
We have found a ridiculous way around this that doesn't work in all circumstances but.... We are running a python script from a toolbox inside a task. And we happen to have some dummy data in a few layers that we had to add for reasons I can't be bothered to go into here. So... the workaround....
We run the script though a command in a task and then as hidden steps in the task we select the dummy data from one of the layers and calculate a field in this layer for the selected features to null (this field for these features are null already). This seems to initiate a refresh of all the data in Pro.
So annoying but at least it's working.... most of the time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.