You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixes#1084
This explains how to run the default Evolution's
`importPreFilledResponses.tasks.ts` task. It explains the required
fields and what they map to. For basic address imports, this script may
be sufficient, but for more complex data, surveys may need to extend or
rewrite it.
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -218,5 +218,26 @@ To view the generated HTML documentation, you can use an extension like **Live S
218
218
219
219
Alternatively, you can use any HTTP server to serve the `docs/internalApi` folder and view the documentation in your browser.
220
220
221
+
## Import data to pre-fill surveys
222
+
223
+
It is possible to import data that will be used to pre-fill the response of an interview, for example, the address, to match with an access code.
224
+
225
+
The data to pre-fill can be imported from a csv file and use the script from Evolution: `importPreFilledResponses.task.ts`.
226
+
227
+
The import script supports the following fields: `AccessCode`, `PostalCode`, `Address`, `AptNumber`, `City`, `Province`, `AddrLat`, `AddrLon`, `PhoneNumber`, which are all optional. The `AccessCode` field is used as the reference value, ie the one that uniquely identifies the corresponding response row. The other fields will be used to prefill the home address and geography if available. They are mapped respectively to `home.postalCode`, `home.address`, `home.apartmentNumber`, `home.city`, `home.region` and the lat/lon values go to the `home.geography` field. Any additional field, as well as all the entered fields, in the csv file will be put in a `home.preData` field, available in the interview's `response` object, but not editable.
This file can be imported by running the following command: `yarn node packages/evolution-backend/lib/tasks/importPreFilledResponses.task.js --file /absolute/path/to/file.csv`.
239
+
240
+
For a custom import or to support additional fields, the import task of Evolution can be copied and modified.
241
+
221
242
## Nomenclature
222
243
For naming consistency, see [Nomenclature](docs/nomenclature.md)
0 commit comments