HOW TO

Set consistent formatting and spelling for responses in ArcGIS Survey123

Last Published: July 21, 2022

Summary

When creating a survey, some responses require specific formatting or spelling. For instance, when spelling out a complex drug's name such as Levetiracetam, or when entering a ZIP code, the spelling and format must be accurate to avoid inconsistencies and misinterpreting data. Setting some constraints or conditions to these questions controls the format and spelling of the responses.

This article provides three methods to ensure consistent formatting and spelling for responses by setting constraints or conditions in the ArcGIS Survey123 questions.

Procedure

Set the appearance to autocomplete

Autocomplete can be used for questions that have a list of answers to choose from, such as a list of students in a class, country names, and months in a year. Setting the select_one question appearance to autocomplete narrows the options when the first few letters of the word are typed. Spelling inconsistencies can be avoided when choosing the answer from the list.

Note:
The autocomplete option is only available for the select_one question type with a list of answers on the choices sheet. Refer to the Appearance worksheet of the XLSForm, or ArcGIS Survey123: Appearances for more information on the appearance and the question type.
  1. In ArcGIS Survey123 Connect, open the XLSForm file of the survey.
  2. In the survey worksheet, in the appearance column of the question, select autocomplete from the drop-down list.
XLSForm with an autocomplete option selected in the appearance column of the questions.
  1. Save the XLSForm file.
  2. In ArcGIS Survey123 Connect, publish the survey.

In the survey, the options from the drop-down list are narrowed down to display only a few drugs' names containing the letters LE.

The options from the drop down list in the survey narrow down and display only the options containing the letters LE.

Use the regex() function

The regex() function controls how the responses must be entered. When using the function, the responses must follow the format defined by the function before submitting the survey. This function can be used for text, integer, or decimal question types. Refer to ArcGIS Survey123: Regular expressions for more information.

  1. In ArcGIS Survey123 Connect, open the XLSForm file of the survey.
  2. In the survey worksheet, in the constraint column of the question, type the following regex () function for the questions:
regex(.,'<word>')
regex(.,'^\d {<digit>}&')
  1. Save the XLSForm file.
  2. In ArcGIS Survey123 Connect, publish the survey.

In this example, regex(.,'Street) is typed to ensure the word 'Street' is typed in the response. A word such as 'streets' prevents the submission of the survey. The regex (., ‘^\d {5} $’) expression is used for the integer question type, allowing only five-digit numbers in the response.

XLSForm with a regex() function typed in the constraint column of the questions.
Note:
Refer to the Reference worksheet of the XLSForm under the Regular Expressions section for a list of regular expressions that are available in ArcGIS Survey123 Connect.

In the survey, the "Invalid" error message is returned when the responses do not contain the word 'Street', or a five-digit number in the respective questions.

The Invalid error message is returned for the Street name and zip code questions.

Set the appearance to predictivetext

Set the appearance to predictivetext to enable predictive text when responding to the questions in the ArcGIS Survey123 application for mobile devices. Refer to ArcGIS Survey123: Text for more information on predicitve text.

Note:
Predictivetext and nopredictivetext appearances are not supported in the ArcGIS Survey123 web app. Refer to ArcGIS Survey123: Question types for more information on XLSForm features that can be used in ArcGIS Survey123 applications.
  1. In ArcGIS Survey123 Connect, open the XLSForm file of the survey.
  2. In the survey worksheet, in the appearance column of the question, select predictivetext from the drop-down list.
  3. Save the XLSForm file.
  4. In ArcGIS Survey123 Connect, publish the survey.

In this example, predictivetext and nopredictivetext are selected in the appearance column of the questions.

XLSForm with predictivetext and nopredictivetext options selected in the appearance column of the questions.

In the published survey, the predictive text is displayed for the question with a predictivetext appearance (image on the left) and not displayed for the question with a nopredictivetext appearance (image on the right) on an Android device.

The survey with the predictive text displayed on the left side, and not displayed on the right side of the image.

Article ID:000027933

Software:
  • ArcGIS Survey123 Field App iOS
  • ArcGIS Survey123 Website
  • ArcGIS Survey123 Connect
  • ArcGIS Survey123 Field App Android

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic