English

How To: Display questions based on the geopoint question in Survey123 Connect for ArcGIS

Summary

When creating a survey in Survey123 Connect for ArcGIS, it is possible to control the visibility of a question in the survey based on the value of a geopoint question. For example, when a question must be shown if the geopoint is in a specific city.

Procedure

To tie the visibility of a question based on the value of a geopoint question, use the pulldata and reverse geocoding functions on a note question type to find the location of the geopoint question. Then set the desired location in the relevant column of the question tied to the location. The pulldata reverse geocode can be based on either an address or other parameters created in a reverse geocode, such as the city.


For example, with a geopoint in Redlands, create a note question type in the survey that pulls the city from the reverse geocoded address of the geopoint. Use the following calculation in the calculation column for the note question type.
pulldata("@geopoint",${location},"reversegeocode.address.City")
Screenshot of the XLSForm with the pulldata calculation highlighted

This pulls the city name of the reverse geocoded address. In the question that becomes visible based on the geopoint location, add this statement to the relevant column.
${address}="Redlands"

Screenshot of the XLSForm with Redlands highlighted

By this configuration of the survey, the text question type would only be visible if the value of the note question type is Redlands.

Screenshot of the survey showing the hidden text type when Redlands is geocoded.

The value used from the geocode can be other parameters, such as using the matched address reverse geocode output with the following calculation in the calculation column of the note question type:  
pulldata("@geopoint",${location},"reversegeocode.address.Match_addr")
And use the following statement in the relevant column of the question tied to the note:
${address} = "W Fern Ave & Terracina Blvd, Redlands, California, 92373"

For more information on using the specific parameters of an address from the reverse geocoding, see ArcGIS REST API: Choosing specific output features.
 
Note:
Applications are contractually prohibited from storing the results of reverse-geocoding transactions unless requested by passing the forStorage parameter with a value of true and the token parameter with a valid ArcGIS Online token. ArcGIS Online service credits are deducted from the organization account for each geocode transaction that includes the forStorage parameter with a value of true and a valid token. For more information on how credits are charged, see ArcGIS Online: Service Credits Overview.

Related Information