You can pre-populate a form with data from a CSV file. This is useful in many scenarios such as baseline data that you want to include in a follow-up form.
Step 1: Get your data into a CSV file
Set up your CSV with the data that will be referenced in your form, including the name/PID that will be used to match with the field in the form. The easiest way to generate a CSV is to create a spreadsheet using Microsoft Excel or Google Sheets and then save as a CSV file.
Hint: Dates should always be in the format yyyy-mm-dd
Here's an example of a CSV file:
Step 2: Upload the CSV file to your project resource library
Once you have saved your data to a CSV file, you can upload it to your project resource library. Uploading resources to your library is covered in more detail in the article
Step 3: Pull the data into your form
1. Add a field to enter the name/patient ID for example. This will be matched with the corresponding data in the CSV file.
2. Add a calculation field with the =pulldata() function in the formula to retrieve the data from the CSV file - e.g. =pulldata(@TestFile.csv, "Occupation", "PID", $PID)
- The first parameter is used to reference the CSV file using the '@' sign.
- The second parameter refers to the column that contains the data you wish to populate.
- The third parameter is used to locate the column you wish to match.
- And the last parameter is the value you want to match on. You can reference another field by using the '$' sign.
Data from the pulldata() function will be included with the form submission data in the analytics grid.
Step 4: Reference the data in your form (optional step)
Once the data is loaded using the pulldata() function, you can reference the field (with the '$'sign) in another field's label or use as skip logic / validation conditions, just as you would reference any other field.
Tip: To see pulldata() in action, use the 'Preview' button on the far right in your top toolbar to view the form in mobile or web view.