Select to view content in your preferred language

Auto-calculate values using underlying polygon layer

1319
4
06-21-2022 10:22 AM
Status: Implemented
Labels (2)
JohnNergeBrooklynPark
Occasional Contributor II

It would be awesome to be able to auto-assign values to a survey point by using other geographic layers. As an example, we have a survey our community can use to report a public health or code-related issue. We have a webhook to auto-email the public health team when a new request comes in, but since each inspector is assigned to a certain part of the city, we'd prefer to email them directly instead of using a generic team email. We have a GIS dataset of their inspection zones with their names and emails as attribute values.

So, the process would look like this:

  1. Someone submits a new survey response
  2. Upon hitting submit, the survey runs a spatial join/intersect/etc. to determine which inspection zone the response was geolocated in.
  3. The survey assigns the name and email of that inspector as attribute values on that survey response
  4. We can then use that data in a webhook to email the inspector assigned to that specific area

If it was possible to auto-calculate the zone as part of the pre-submission process (i.e.) it calculates when a map question is answered), it could also be nice for customizing the survey based on the zone their in, such as if there are different event times based on council districts, recycle zones, or other types of ways to divide a geography up.

Not sure if this is possible in Survey123 Connect or not, but ideally this would be something you could do in the Web Designer too.

4 Comments
ThomasHamill

@JohnNergeBrooklynPark, I'm not aware if a definitive solution for this has already been prototyped, but there were some really good ideas shared by @DougBrowning in another thread here.

IsmaelChivite
Status changed to: In Product Plan

Thanks for your Idea. This is currently supported through the use of custom JS functions. Functional examples available here: https://community.esri.com/t5/arcgis-survey123-blog/extending-survey123-smart-forms-with-custom-js/b...

One challenge with custom JS functions is that they do not work if your survey is shared publicly. To address this, we have plans to incorporate pulldata("@layer").   Please check details here:

https://community.esri.com/t5/arcgis-survey123-blog/survey123-april-2022-now-available-in-beta/ba-p/...

 

JohnNergeBrooklynPark

Ah man, thanks @ThomasHamill - clearly I forgot that I found that post and commented on it a few weeks ago. Next time I'll try searching for existing ideas a little harder.

And thanks for the update. @IsmaelChivite - that will be a really nice enhancement!

JamesTedrick
Status changed to: Implemented

This functionality is now available using the pulldata('@layer') function.  Please refer to the Survey123 documentation and the Esri Community blog post on this functionality.