How to use pulldata in Survey123?

6.27K viewsAdding Data
0

How to use pulldata functionality to link CSV baseline file with Survey123 newly created form?

Changed status to publish
0

We can preload data from a CSV file that you include in the media folder of your survey by using the pulldata() function in the calculation column of a question. The pulldata() function requires the following four parameters to be specified in the order.

  1. The name of the CSV file that contains the list of values. The name does not include the .csv file name suffix.
  2. The name of the column in the CSV file that contains the value you want to return.
  3. The name of the key field in the CSV file that you will use to look up the value.
  4. The key value to look up in the key field.

These values can be defined directly or through variables defined elsewhere in the survey. In the following example, the calculation returns the name  of  an individual whose house ID is entered  in a previous question {house_id} from a CSV file called Sample:

pulldata(‘Sample’,’Name’,’ID’, ${house_id})

where, ‘Sample’ = CSV filename without .csv

‘Name’ = Column name in the CSV file that contains the value you want to return.

‘ID’ = Column name of the key field in the CSV file that you will use to look up the value

${house_id} = The key-value enter by the user to look up in the key field.

 

Please download the Sample.cvs file and Survey123sample.xlsx file to view the usage of the pulldata() syntax.

 

The same pulldata() function also works in the constraints column, preventing the user from submitting answers that are not in the CSV file. In the constraints column, this same formula prevents the form from accepting any values that are not in the CSV file’s name column.

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 baseline/previous survey or can provide multiple answers based on the user’s entry of a single answer.

 

Notes:

  1. The pulldata() function can’t be used to populate the values of select_multiple questions.
  2. If values in your CSV file exceed 255 characters, you must enter a higher value in the bind::esri:fieldLength column for both the question you’re populating with the CSV content and any questions being used as input to the pulldata() function. If your CSV file includes values that are larger than the maximum length of one of these fields, a survey response fails to submit and displays a Code 1000 error.
  3. When using the pulldata() function, your CSV column names cannot contain spaces, hyphens, or other special characters.

 

External Resources:

  1. ArcGIS Survey123- Formulas 
  2. ArcGIS Survey123- Prepopulate Answers
  3. Geonet- Use existing data in your survey – the pulldata( )

 

Read More »How to use pulldata in Survey123?

Changed status to publish

Stats for this question

  • Active
  • Views6268 times
  • Answers1 answer

Help categories

Search questions