-
Notifications
You must be signed in to change notification settings - Fork 12
Description
When using importRecords in the R package, the matching algorithm requires the user to always provide the reference field label. This is problematic as when users export a form with a reference field from ActivityInfo, the export will "unroll" the reference field using the key fields defined on each form, and use the reference form label concatenated with key field label for column headers. Unfortunately this means that users will often not be able to use the export CSV/XLSX from ActivityInfo as a template for import via the R package, which is a poor user experience.
Take the following form design:
- Registry
- Name: Text
- Location of registrant: Reference [City]
- City
- Name: Text (KEY)
- Country: Reference [Country]
- Country
- Name: Text (KEY)
The table view/exporter will take the key fields from the referenced form and export the following headers:
- Name
- City Name
- Country Name
And the (manual) importer will match the columns accordingly:
- Name =>
Name
- City Name =>
[Location of registrant].Name
- Country Name =>
[Location of registrant].Country.Name
The R package should follow a similar matching algorithm to allow easy reuse of the exported column format.
CC: @Ryo-N7