Select to view content in your preferred language

Automatically Update Layer After Creation (e.g. in Survey123)

338
2
09-12-2023 11:49 PM
MarcoPoetsch
Frequent Contributor

Hello Geonet community,

I'm working with Survey123 to create polygons in a feature layer. As soon as a polygon gets created, I want to automatically update a specific field within this new feature. Specifically, I'd like to calculate how many points from another feature service are located within this newly created polygon.

Thanks in advance for your insights!

2 Replies
MobiusSnake
MVP Regular Contributor

I think you have two options:

The benefit of webhooks are they're effectively instantaneous.  The downside is they typically require set up with a webhook provider and (likely for this task) some kind of serverless computing, e.g. Azure Functions or AWS Lambda.

Scheduled notebooks aren't instantaneous but in my opinion they're easier to deploy and require nothing outside of the ArcGIS Online platform.  I'd recommend adding two fields to accomplish this, an "is processed" integer field that is 0 by default, and your calculated field.  Set up a notebook to run some Python that calculates your point count and sets the "is processed" flag to 1, then created a hosted feature layer view with a filter so that only processed features are visible.  Your polygons might end up in limbo for a short period of time, but they won't be exposed through the view until the point count is properly set.

MarcoPoetsch
Frequent Contributor

Thanks @MobiusSnake,

yeah, I thought about both options.

However, I don't have a webhook provider. So this won't work.

I do like the second option of having a notebook, but as you said, it won't be instantaneous, unless I host this on Enterprise, which is for this project not an option. Thanks for sharing your ideas about how I can process new data. That's actually a good idea.

0 Kudos