Skip to content

importRecords does not match on form label/key field label when importing references #129

@jamiewhths

Description

@jamiewhths

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions