Issues with publishing and overwriting web layers using modelbuilder

1477
16
Jump to solution
08-26-2021 08:23 AM
JD1016
by
Occasional Contributor

Hello Everyone,

I'm currently using ArcGIS Pro 2.8.2.  I happened upon a script that was graciously shared by Jonah Lay to publish and overwrite web layers in Modelbuilder (see JonahLayCode.txt).  I followed the directions for adding the script, creating the script tool, and adding to an existing model.  The directional post from Jonah can be found here: https://www.esri.com/arcgis-blog/products/arcgis-pro/mapping/publish-and-overwrite-web-layers-in-mod...

I've attached a screenshot that illustrates my model with the Publish Web Feature Layer section added (see AutoPublishOutagesScreenshot.png).

In running the model as it is illustrated in the above screenshot, I received the following error messages (see AutoPublishOutagesFailureScreenshot.png).

I am not a programmer.  That we just establish. To that end, can someone please offer some kernels of wisdom on how I may succeed in using this script successfully given the errors I have encountered?  I'm sure it is something that I have not done properly given the indicated messages.

Thank you one and all in advance.

JD

0 Kudos
1 Solution

Accepted Solutions
JonahLay
Esri Contributor

Hi Jeff,

I believe you are seeing this behavior because your script tool hasn't been modified to include the portalFolder property. The Next Steps section in the blog covers how to do this.

Hope it helps,

Jonah

View solution in original post

16 Replies
JonahLay
Esri Contributor

Hi,

Thanks for the screenshots. Just a quick question first... Are you attempting to publish a web feature layer to ArcGIS Online or ArcGIS Enterprise?

Thanks,

Jonah

0 Kudos
JD1016
by
Occasional Contributor

Hi Jonah,

Thank you so much for replying.

I am attempting to update a hosted feature layer on ArcGIS Online.

Jeff

0 Kudos
JonahLay
Esri Contributor

Hi Jeff,

I tried recreating the model in your screenshot and was able to successfully publish a web feature layer. I'm not seeing any issues with the script itself. There are a couple things that might be worth checking though:

  1. Are the output data variables set to Add to display? (Right-click Layer Name and YukonOutageLocsAGOWMPro in your model).
  2. For the map variable—Do you have other layers or tables in your map, or is it just the stand-alone table (mapLocations...csv)?

Best,

Jonah

 

0 Kudos
JD1016
by
Occasional Contributor

Hi Jonah,

Thank you for doing some investigating.  It's much appreciated.  Yes, the output layer (YukonOutageLocsAGWMPro) is set to Add to Display.  Other than the mapLocations...csv file called on as a table variable, both the World Topographic and World Hillshade are present in the map and form the basemap under the YukonOutageLocsAGWMPro locations.  Could that be the issue?

Thanks.

Jeff

0 Kudos
JonahLay
Esri Contributor

Hi Jeff,

No, the basemaps shouldn't be a problem. The error, "No Layer or Table was initialized" seems to indicate that no layer or table was present in the input map (though you should have received an analyzer error if this was the case). If you can confirm that the input map is correct, then I'm not sure what else could be causing the issue. If you are willing to share the project and data as a package, feel free to message me privately and I can take a closer look.

The following help topic has some suggestions you can also try: https://pro.arcgis.com/en/pro-app/latest/tool-reference/tool-errors-and-warnings/999001-999999/tool-...

If nothing else works, contacting Technical Support might be your best option.

Best,

Jonah

0 Kudos
JD1016
by
Occasional Contributor

Hi Jonah,

Should my .csv file be located as a standalone table in the map?  The lead-off table variable in modelbuilder is "pointed to" the location of the csv file.

Thanks.

Jeff

0 Kudos
JonahLay
Esri Contributor

I don't think that would make a difference, but it is worth trying. You can add the file to the map, then drag it into the model as a variable.

0 Kudos
JD1016
by
Occasional Contributor

I went through the suggestion help topic and decided to check the csv file for "empty cells".  I removed the offending records that did not possess XY coordinate information and the script without errors.  However...and there is always an however...right...I checked my corresponding AGO layer...the one that should be updated and sure enough it was recently updated...but when I go to the layers items details section...Data tab...it refused to load the data.  I then attempted to open the layer within a new AGO map and there are no point locations showing.  Any thoughts?

0 Kudos
JD1016
by
Occasional Contributor

I should probably add that only the hosted feature layer shows today's date but it's corresponding service definition file on AGO is unchanged and shows yesterday's date.

0 Kudos