How do I automatically assign a value based on a response to a geopoint location question?

428
3
08-17-2021 12:37 PM
TatjanaScagliotti
New Contributor III

I have a form I created in Survey123 Connect that asks people to drop a pin in the location they sighted an invasive plant. I also have a field called management areas which is a text field with various coded domains. I want to automatically assign the management areas field a value based off the location in the previous question and I'm not sure how to do that. I am familiar with the pull data function but I don't think that will be useful in this case. 

Any help would be great!

3 Replies
AllisonHollier
New Contributor III

Definitely watching this.  It's an interesting concept.  It sounds like you need a GIS function like "contains", but if you're list isn't an actual layer on your map, that won't work.  I'll be interested to see what pops up...

 

0 Kudos
DougBrowning
MVP Notable Contributor

Do you mean spatially? 

A Custom geocoder may work.  You need to look that up I have never tried it.  Uses pulldata somehow I think.

Another idea is post processing.

Another idea is Arcade but it would just be a popup value in the web map.

The new search() may work.  It is Early Adopter program only for now so need to look there under Dynamic choice list.

You would need to be online for this.

When using the search() appearance with feature layers, you can use @geopoint, @geotrace, and @geoshape for the searchColumns depending on the geometry of the feature layer you are querying.

For search type, the following searchTypes are supported. This list comes from the spatial relationship (spatialRel) parameter when querying a layer from a feature service or map service :

Intersects
Contains
Crosses
Envelope_intersects
Index_intersects
Overlaps
Touches
Within
When using a feature or map service, the tableName parameter will take the form of “<tablename>?url=<Layer REST URL>” and the REST URL will include the layer index for the specific layer you want to query. The <tablename> portion of the parameter does not need to match the actual name of the hosted layer, it is only used internally by Survey123 to organize the choice list. You should give each <tablename> a unique value if you are using multiple search() appearances within your survey. In the example below we are querying the Wildfire Perimeters feature service so the tableName URL that gets specified is “wildfire?url=https://services3.arcgis.com/T4QMspbfLg3qTGWY/ArcGIS/rest/services/Public_Wildfire_Perimeters_View/F.... We will provide a few samples that use the Wildfire Perimeters feature service below but will focus on searching for fires based on state for the remainder of the documentation.

As outlined below, feature layers can also perform attribute queries and are not limited to spatial queries as outlined above. The syntax is very similar to the method used for CSV files with the exception of the tableName pointing to a feature layer REST URL instead of a CSV file.

Similar to the CSV implementation, specify the selection question you would like (select_one or select_multiple) and specify a choice list name. You will then enter your search expression.

Hope that helps.

JohnNerge1
Occasional Contributor

Just had this come up, we implemented a new code enforcement and other issue reporting survey, would love to be able to grab the underlying inspection area so I can then set up a direct email to the assigned inspector via a webhook.

0 Kudos