Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jamiewhths opened this issue Jul 18, 2024 · 3 comments
Assignees

Comments

@jamiewhths
Copy link
Contributor

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

@akbertram
Copy link
Member

akbertram commented Jul 18, 2024 via email

@jamiewhths
Copy link
Contributor Author

@Ryo-N7 for your import via importRecords, you will need to import your records with the reference record id and using the reference field label rather than the key fields in your current import file.

@nickdickinson
Copy link
Collaborator

Can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants