I have a dynamic query layer (polygon) derived from feature class and SQL table, I was able to share it to ArcGIS Online as a web layer.
1- I would like to setup an automated workflow for overwriting or append to hosted feature services within our ArcGIS Online Account (stand alone arcpy script) and schedule that for everyday update. I tried this one Update Hosted Feature Service with Feature Class but got this error. I am not interested using Python API,
2- Where is the path of Query Layer (workspacePath) ? I know its generated and already shared to ArcGIS Online.
3- also I went through this one Best Practise for scripting updating of hosted feature services?
but none of them helped.
The easiest approach would be to create a model and run the Delete Rows to delete all the records from the feature service, and then execute the Append tool to append features from a feature class to the feature service.
Once you have the model created, you can set this up to run at a prescribed time. See the following help document on how to do this using ArcGIS Pro 2.5:
I created the Model for deleting and Appending,
and It work Perfect, the problem now with the Schedule,I keep getting this error. I am not Sure Is windows related or ArcGIS Pro issue.
As an alternative, you can export the model to a python script, and then try configuring Windows Task Scheduler to execute the script:
this exactly what I did, any how will figure it out, my main issue now is how to set the time field
because the append now reset the date/time field to UTC -5, while I need it to be UTC -6 Central Time.
Have you tried the convert time geoprocessing tool? I had this issue a few weeks back and had to incorporate this tool into my process. Not sure if this helps you, but it worked for me.
I've created a model its working fine when I run it from the Model Builder - ArcGIS Pro, but which fails when it is scheduled. In the Windows Scheduler window I get a (0x1) "Last Run Result" status. Apparently when working with hosted layers it isn't as simple as it sounds.
Could you provide a simple example of how to create a model that interacts with a hosted feature class with windows Scheduler.
When you get time, I posted few questions here, still looking for answers.