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, or when a question becomes relevant. 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 necessary, but setting the default answer can save you time when completing your surveys. Default answers can contain constants such as strings and numbers.

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, geotrace, and geoshape questions support default answers. For more information about setting a default, see Geopoints and Geotrace and geoshape.

Calculations

Calculations are similar to defaults, but there are differences. Unlike the default column, which is evaluated only when the survey is opened or the question becomes relevant, calculations are evaluated every time answers in your survey that are inputs to the calculation change or become relevant. Calculations can use existing answers in your form. For example, the expression 100 - (${integer1} + ${integer2}) entered in the calculation column of a question sums the values of questions integer1 and integer2, subtracts that value from 100, and sets that value as your answer. The user can overwrite that value, but the calculation can provide a starting answer to guide the user.

Tip:

If the result of a calculation is manually edited, you can use the button that appears to erase the edited value and run the calculation again.

Geopoint, geotrace, and geoshape questions can also support calculations.

Device and user properties

The pulldata() function supports extracting additional properties using the format pulldata("@property", 'propertyname'). These properties are useful to gather information about the context in which your survey was taken, as well as providing additional technical details.

PropertyDescription

pulldata("@property", 'portalurl')

The URL of the portal to which the survey is submitted.

pulldata("@property", 'token')

The token passed to the feature layer.

pulldata("@property", 'portalinfo')

All portal information, as a JSON object.

pulldata("@property", 'online')

A Boolean value. The value is true if the device has network activity; otherwise, it's false.

pulldata("@property", 'utcoffset')

Offset in hours from UTC for the local time zone.

pulldata("@property", 'language')

Language used in the current survey.

pulldata("@property", 'timezone')

Time zone code.

pulldata("@property", 'mode')

Returns new if the user is creating a survey response, edit if the user is editing an existing response, or view if the user is viewing a response in read-only mode.

pulldata("@property", 'status')

Returns draft, submitted, sent, or inbox if the survey was opened from Drafts, Outbox, Sent, or Inbox, respectively. An empty string is returned if the response is new.

Favorite answers

After you've entered answers into the Survey123 field app, you can save them 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.

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 enter 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 is marked with a star.

Note:

If the Sent page has been disabled, a sent survey cannot be used for favorite answers. In this case, saving your survey with favorite answers as a draft allows the Paste answers from favorite option to work.

CSV data

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

Prepopulating answers is useful in asset inspection surveys. By entering an asset ID number (by typing it or 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.