Select to view content in your preferred language

Appending to a hosted feature using a web tool in WebApp Builder (Enterprise 10.9.0)

695
2
12-28-2023 10:58 AM
PPoudel
Emerging Contributor

Hello, I'm trying to achieve a specific workflow in ArcGIS Enterprise 10.9.0 within the geoprocessing widget in Web App Builder that requires me to append to a hosted feature service. This works fine if I'm appending from within ArcGIS Pro, but as I mentioned before, I'm trying to achieve it via a web app.

Here is my ModelBuilder workflow:

PPoudel_1-1703783072212.png

The basic idea is the user specifies a polygon (Parameter 3) and the number of random points they want created within this (Parameter 1) area. A tool will create the points, then add a new text field, FieldName, to the points that will then store 'Parameter 2' as the value in those fields. 
These points, which have been created in memory, are appended to an existing hosted feature. I have a custom Python script at the end that just assigns some ID numbers.
When I add the hosted polygon and point layer to ArcGIS Pro (via URL) and run the model, it works flawlessly and the newly created points are appended to existing points in the hosted feature. 

So, I went ahead and published the model as a Web Tool using ArcGIS Pro 2.7 (otherwise the Field Calculator 'Enforce Domains' setting will throw an Error). I loaded the GP Service into the Geoprocessing widget but it seems like when I run the tool there, it doesn't append to the hosted feature anymore (even though it does so when I run it on Pro), it creates a new temporary layer that it then appends to.

If I try to put the name of the 'Hosted Feature' as the output layer name, it gives me the error: 
PPoudel_2-1703789820835.png

  • The Hosted Feature output feature service name is not valid or already exists.
  • Failed.

My question is this: Is there any way for me to accomplish what I am trying via a web app? Can I append to an existing hosted feature using the GP widget in Web App Builder? If so, what am I missing in these steps? I am happy to provide any additional details or screenshots.

0 Kudos
2 Replies
PeijunCai
Esri Alum

Hello, when you publish the GP tool to your Enterprise environment, does the tool run on the REST Endpoint? If not, what errors are you seeing? If the tool runs fine on the REST Endpoint, the tool should run in Web AppBuilder.

0 Kudos
PPoudel
Emerging Contributor

Thank you for your response.

Yes, the tool runs successfully on the REST Endpoint. The issue is that the behavior of the tool in the REST endpoint/ Web AppBuilder environment is not the same as the behavior in ArcGIS Pro. 

In the screenshot of the tool in Web App Builder, if I leave 'Output Feature Service Name' blank, then the tool creates a new temporary hosted feature with the appended data instead of appending TO the hosted feature.

If I enter the name of the hosted feature 'Hosted Point Feature' in this space, as shown in the screenshot (in an attempt to overwrite the hosted feature with the appended data), then it gives me the error I mentioned in the original post. 

So the tool runs successfully in Pro with the desired behavior, and runs successfully in the Portal/REST environment without error but with different behavior of creating an appended temporary hosted feature as opposed to appending to the original hosted feature.

0 Kudos