Combine Delete Rows and Append tools to make a single Overwrite tool to be used in ModelBuilder. (a no code solution)
For background I have a Hosted Feature Layer, that is overwritten daily. The data is coming from a CSV that gets processed in ModelBuilder.
1st Delete Rows removes all records from the Hosted Layer
2nd Append the Hosted_Feature_Layer with the processed Feature_Layer_Temp
Every time the model runs the entire Hosted Feature Layer is refreshed with new data from the processed CSV. The Hosted Layer id stays the same, so no need to reconfigure anything consuming he layer.
The only downside is the ObjectID increased every time the model is run.
I would love to see the Delete Rows and Append combined in a single Overwrite tool. Perhaps improving the ObjectID issue.
Our sharing team published this blog with a sample of how to overwrite in a model https://www.esri.com/arcgis-blog/products/arcgis-pro/mapping/publish-and-overwrite-web-layers-in-mod...
For what you're describing though, have you simply tried using the Truncate Table tool rather than Delete Rows? https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/truncatetable.htm
That will solve your stated problem of the objectid not resetting (as long as it works on your hosted feature service).
Thank you for the quick response, we are on portal 10.8.1 and have previously ran into a bug after 4-6 weeks of a daily overwrite that completely corrupts a hosted feature layer. We believe this has been fixed in 10.9.1 however while in the works, the upgrade will take us a while. https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEzMTM2Ng==
Thank for the tip on the Truncate Table Tool, sadly "This tool does not support a feature service layer as input." until Pro 3.0. With some Pro 3.0 files not being backwards compatible, as an organization we will need to plan the upgrade careful to bring everyone up to Pro 3.x at the same time.
Thanks for the additional details, Ryan. You're right, it looks like the ability to Truncate a feature service was added in ArcGIS Pro 3.0. So hopefully once you're able to upgrade, that will provide the solution you're looking for.
Be sure to thoroughly review https://www.esri.com/arcgis-blog/products/arcgis-pro/announcements/get-ready-for-arcgis-pro-3-0/ and the referenced migration documentation if you have not already (sounds like maybe you have which is good)!
Ryan if you have Data Interoperability extension you can refresh your target layer with a changes-only data set, let me know if that if of interest.
Great idea, I will check if we have any Data Interoperability licenses available. Only updating changes sounds much cleaner process, and will improve time on the larger datasets.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.