Ability to Overwrite Hosted Feature Layer Within ModelBuilder

10526
31
02-12-2020 07:33 AM
Status: Open
Labels (1)
LindsayMaier
New Contributor III

Let's say you have a model in ArcGIS Pro that you run regularly to clean/change some data, after which you share that layer to your Portal/AGOL. To share the result of this layer, you have to either do it manually (right click --> sharing --> overwrite web layer) after running your model, or you can create a Python script to do it and embed the script into your model. However, there is no simple, out-of-the-box "Overwrite Web Layer" tool that you can drag and drop into a model that will do it. This would be very useful for those of us that aren't great with Python and want overwrite a hosted feature layer from within ModelBuilder. arcgis - pro‌ overwrite web layer‌ modelbuilder‌

Moderator Note

See the blog and sample posted here https://community.esri.com/t5/arcgis-pro-ideas/ability-to-overwrite-hosted-feature-layer-within/idc-p/1089800/highlight/true#M16856

31 Comments
peterweir

Having built a detailed model-builder to update covid records daily and then wanting to distribute to users via arcgis online.

The missing piece is to automatically updated via "Overwrite Hosted Feature"  within model builder

Yes, I'm looking for the possibility to incorporate the share/overwrite web layer functionality as a tool in model builder without scripting or python. Hopefully esri will incorporate in future updates 

Ryan_Gould

To make this work for me, I created the layer in Portal with empty geometry. I then used Append in my model to append the new records to the existing empty feature layer. You can add a Date field, and calculate it using datetime.datetime.now() somewhere in your model. Use this field to append only the new records to the dataset each time.

Lindsay_Maier

@Ryan_Gould that idea is actually pretty genius. While I still hope ESRI incorporates my "idea" at some point, this is a great stopgap for those who don't want to use Python. Thanks for sharing!

JamesShreeve

Part of my role is to update our web layers (internal & external use) from our network data to AGOL. I have a manual process where I use the overwrite web layer tool within ArcGIS Pro which works a treat. I have seen posts regarding other ways to update AGOL layers including ModelBuilder (delete and append) and python....my Python skills are very limited and the ModelBuilder just falls over due to the amount of data on the layer. My question is, is there any view to be able to schedule the Overwrite Web Layer tool like you can with many other geoprocessing tools on ArcGIS Pro by having the option on the Run button? 

Many thanks, 

James

JonahLay

Hi James,

Thanks for posting this idea. In case you weren't already aware, this blog walks you through creating a script tool that publishes and overwrites web layers. We also provide a project with sample scripts. Once you create a model, you can schedule it to run repeatedly or at a designated time.

Best,

Jonah

JonahLay
Status changed to: Closed

Hi Everyone,

Thank you for all the feedback on this idea. Unfortunately, after much consideration and review, we have decided not to move forward with this. Supporting the ability to overwrite web layers in a system geoprocessing tool would be technically infeasible.

As a reminder, you can create your own custom tool by following the steps in the blog shared previously. The article along with a project package containing a sample model and script tools can be found here: https://www.esri.com/arcgis-blog/products/arcgis-pro/mapping/publish-and-overwrite-web-layers-in-mod...

Best,

Jonah

 

RyanBohan

Sad to read this is no longer being considered as an enhancement to model builder.  It is something I would have used heavily as module builder can be set up quickly. 

And is much easier to explain to a non-power user then "open python" copy this script and just modify where needed.  

MarkMansell1

Jonah,

I too am sad to read this is no longer being considered as an enhancement to model builder. However, I was wondering if anyone has used the python code as a stand alone script without variables that can be run through the Windows Task Scheduler? I have a user that is very insistent that I put something together that needs no intervention. And if so, does ArcGIS Pro need to be open for the script to run?

Thanks for any suggestion?

RyanBohan

Hi Jonah,

Yes, I have exported models to python and set them to run in Task Scheduler.  

Pro does not need to be open, I think they run better if Pro is closed in fact.  

I found this youtube that is pretty helpful (skip the first half if you know modelbuilder well).

https://youtu.be/pIfS0saxpi8

MatthewBeal

@MarkMansell1 

Mark, 

To answer your question, yes, it should be able to be run as a standalone script. That being said, even if you schedule it using arcgis Pro's GP scheduler, it should still function, even with arcGIS Pro closed. All the Geoprocessing scheduler does is add an entry into Windows task scheduler for you with the correct settings. I've gotten this working on several scripts, so feel free to reach out to me if you have other questions!