Skip To Content

Prepopulate answers

Answers can be prepopulated in Survey123 in a number of ways.

Default answers

Default answers for survey questions can be set in the default column of your spreadsheet when you're designing your survey. This will prepopulate your survey question with the same answer every time you begin a new survey. This is especially useful when the answer to your survey question will be the same the majority of the time. You can still edit the default answer if required, but setting the default answer can save you a lot of time and energy when filling out your surveys. Default answers can hold constants such as a strings and numbers.

Note:

Survey123 also supports some expressions in the default column, including today() and now(). To conform to the Open Data Kit (ODK) standard, these expressions should be entered in the calculation column.

Answers to select_multiple questions work differently than others, with each checked answer entered in the order it was selected, separated by commas. To define several values as defaults in a select_multiple field, separate them with commas, for example, item1,item2,item3.

Geopoint questions can support default answers. In the default column of the question, enter the coordinates of the default location as latitude and longitude, both in decimal degrees, separated by a space. Latitude and longitude are the minimum required values for a geopoint; you can also optionally include altitude and accuracy in decimal meters.

Calculations

Calculations are similar to defaults, but there are differences. Unlike the default column, which is evaluated only when the survey is opened, calculations are evaluated every time answers in your survey change. Calculations can take advantage of existing answers in your form. For example, the expression 100 - (number(${Q1})+number(${Q2})) entered in the calculation column of a question will sum the values of questions Q1 and Q2, subtract that value from 100, and set that value as your answer. The user will be able to overwrite that value, but the calculation can provide a starting answer to guide the user.

Note:

The example expression shown above includes the number() function. Default values and answers from other questions are treated as strings when used in calculations. To ensure they are treated as numbers, be sure to use the number() function on these values.

Geopoint questions can also support calculations, using the same space-separated values as defaults. To calculate a geopoint from a choice, you can use the substr() or pulldata() function. For more information on both of these, see Geopoints.

Device and user properties

The calculation column also supports the property() function. The property() function is ideal for identifying individual surveys to better understand the source of your data.

When accompanied by a supported property name, for example, property('username'), the function will automatically populate the answer with information about the user submitting the survey. You can add an identifying prefix to the answer by prefacing the property name with uri:; for example, property('uri:username') would produce an answer such as username:JackJohnson. Including the uri: prefix can assist automated processing of the results.

The following is a list of property names that can be used:

PropertyDescriptionExample

property('deviceid')

Returns a psuedo ID generated by the app.

daac05fa91314a11b9a3ab0407e4be40

property('uri:deviceid')

Returns a psuedo ID generated by the app, prefixed by the operating system platform code.

windows:daac05fa91314a11b9a3ab0407e4be40

property('username')

Returns the user's ArcGIS user name.

JackJohnson

property('uri:username')

Returns the user's ArcGIS user name, with identifier prefix.

username:JackJohnson

property('email')

Returns the user's email address.

example@example.com

property('uri:email')

Returns the user's email address, with mailto prefix.

mailto:example@example.com

The value for deviceid is generated once for an app. It is stored in the app's settings and will get regenerated if the settings are deleted. On iOS devices, app settings are deleted when an app is uninstalled.

Values for username and email can only be returned if the user is signed in.

Favorite answers

After you've entered answers into the Survey123 field app, you can save these answers to use in subsequent surveys by setting your favorite answers. Using the menu in the upper right corner, you can set the current state of your survey to act as your favorite answers.

Once you've set your favorite answers, you can insert them into new surveys by opening the menu and clicking Paste answers from favorite. This will enter your favorite answers into your new survey.

If at any time you need to change your favorite answers, enter them into your current survey and click Set as favorite answers. If you find yourself entering repetitive information in a field, you can use your current answers to prepopulate subsequent surveys. The survey that you use to set your favorite answers will be marked with a star.

CSV data

Populating answers with information that you already have stored on your device can be a great way to minimize the time it takes to complete your survey. The information may be data collected from a previous survey or may provide multiple answers based on the user's entry of a single answer.

An asset inspection survey is an example where prepopulating answers is useful. By entering an asset ID number (by typing it or perhaps scanning a bar code), details of that asset can be retrieved from the CSV file and used to answer other questions such as location, last inspection date, and condition at the time of last inspection.

For additional details on how to populate answers in this way, see Work with external content.