Ability to Overwrite Hosted Feature Layer Within ModelBuilder

10471
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
BrunoGomes_de_Souza

It will be a great function!!!

ColeAndrews

Upvoted. This is invaluable for those using services.

RyanBohan

At the 2021 Esri UC asked about the best way to overwrite a hosted feature layer in AGO, got the best response "There will be a sample/template model provided with the release of ArcGIS Pro 2.9". 

MattCashen

@RyanBohan that is great news! Been waiting for this feature for some time. 

MichaelWilliamsUSDA

slowclapgroup.gif

JonahLay

Hi Everyone,

Thanks to all of you who have submitted feedback and information about this idea. We've authored a blog that guides you through creating a script tool that publishes and overwrites web layers in ModelBuilder in Pro 2.8. You can customize the script tool to meet your specific requirements. 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...

Please continue to provide any feedback you may have. This will help our team evaluate the need for other resources in future releases.

Best,

Jonah

RyanBohan

Thank you Jonah, the article goes into great details.  I will be sure to post my feedback when I get a change to test it fully

MattCashen

Thanks for the resource @JonahLay .  I've tried running this a few times today and I keep getting this error: "ERROR 000800: The value is not a member of" and it lists all of the various groups within my organization.  Do you have any idea what I might be doing wrong that is throwing this error? 

JonahLay

@MattCashen Are you publishing to one of the groups the error lists? I'm assuming you are a member of that group. Did you provide the name of the group exactly as it appears?

MattCashen

@JonahLay When the error kept coming up I wasn't telling the tool to publish to any groups.  I seemed to have fixed that by enabling the group parameter to allow multiple values and then creating a value list of my organizations groups.  However, now I'm getting the same error for the share organization parameter: "ERROR 000800: The value is not a member of SHARE_ORGANIZATION | NO_SHARE_ORGANIZATION" 

I am running some tools prior to this one within the model.  I'm joining two layers together and then using the feature class to feature class tool to export that joined layer.  I then set that up as a precondition and that all seems to run properly in the model before I get the errors with the web publishing script.