import from CSV field to array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    import from CSV field to array

    I have a CSV file to import, where some fields are text strings, separated by comma, as field=value1,value2,value3. In the target each value should be imported to a multiple link field, where I have pre-defined values according to the csv values.
    How will I have to format the csv-field to serve the array of all values to the target?
  • alexreynolds
    Junior Member
    • Jun 2024
    • 2

    #2
    Originally posted by shalmaxb
    I have a CSV file to import, where some fields are text strings, separated by comma, as field=value1,value2,value3. In the target each value should be imported to a multiple link field, where I have pre-defined values according to the csv values. quordle
    How will I have to format the csv-field to serve the array of all values to the target?
    To import this into a multiple link field in the target, you would:

    Split the field value by the comma to get an array: ["option1", "option3", "option5"].
    Map each array element to the corresponding pre-defined value in the target multiple link field.​

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1602

      #3
      alexreynolds, does "split by the comma" mean, every option becomes a column of its own in the CSV? And where in the import I would map the single colmns as an array, as the multiple link field is one field in the import?
      Or does your approach mean, I will have to import the multiple link options in json?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8440

        #4
        When importing array, multi-enum and checklist fields, it supports two formats:
        • JSON array
        • Values split by comma

        The following CSV can be imported:

        Code:
        name,arrayField
        "test","Test,Hello"​
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment


        • shalmaxb
          shalmaxb commented
          Editing a comment
          thanks, got it
      Working...