Select to view content in your preferred language

Can the Refresh Datasource command be automated in Tasks?

149
1
02-04-2025 11:42 AM
Labels (2)
Michele_Hosking
Regular Contributor

I am still trying to find a solution to the problem identified in this idea post:  Refresh Datasource arcpy command

I am running a python script which is in a toolbox tool and running from a task.  It updated the attribute table only in a versioned feature class from an enterprise geodatabase. It runs and it actually does update the attribute table but this ArcGIS Pro does not acknowledge this.  That means then next task which runs a model to select data based on data created in the previous step does not select anything since Pro doesn't think there is anything to select.

I have all this set up in scrips and tasks as we are automating as much as possible a process for non-GIS staff.  To ask them to remember to go to List by data Source in the the Catalog pane, find the right data source connection (there are lots in the project), right click and choose refresh is a lot. And to remember to do it before the next step in the process is another thing again.  I really need a solution.

I came across this in Stack Exchange - it's a bit old now but is it actually possible to automate a data source refresh from Tasks?  I've been trying all sorts of things but I can't get it to work.  If it is possible, any help/instructions on how to do this would be fantastic.  

0 Kudos
1 Reply
Michele_Hosking
Regular Contributor

Ok - found a horribly clunky work around where we calculate a dummy record as part of a task in one layer and it refreshes everything in the map.

0 Kudos