Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Support passing fieldAssignments as an input to pre-assign columnsΒ #111

@n2o1988

Description

@n2o1988

Hi, thanks so much for this importer, I'm using it in a side project and finding it very useful.

I've one feature request: could you add a property to pre-define column assignments?
For instance: if I pass a CSV with columns "one, two, three", and I want to assign those to the fields "a, b, c", I want to be able to pass

<Importer
  ...
  fieldsAssignments={{ 'a': 'one', 'b': 'two', 'c': 'three' }}
  // or by index
  fieldsAssignments={{ 'a': 0, 'b': 1, 'c': 2 }}
>

This would have the effect of having the columns already assigned (but still editable), once the user lands on the Fields selection step.
My use case is that I'll be dealing with csvs from different sources pretty regularly, with different formats, and I'd like to automate that step by letting the user save some presets with the mapping on the server side.

Thanks

Metadata

Metadata

Assignees

No one assigned

    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