AnsweredAssumed Answered

Map flat file profile to JSON repeating array objects and values

Question asked by iamperidis522346 on Apr 13, 2018
Latest reply on Aug 14, 2018 by ipatrik560979

I have the following flat file/CSV profile:

field    status  value

--------  -------  -----------

Field1,  1,      value1a
Field1,  1,      value1b
Field1,  1,      value1c
Field2,  1,      value2a
Field2,  1,      value2a

 

I would like to transform/map it to the JSON structure below:

[
    {
    "field": "field1",
    "status": 1,
    "value": ["value1a", "value1b", "value1c"]
  },
  {
    "field": "field2",
    "status": 1,
    "value": ["value2a", "value2b"]
  },

 

I'm only able to map it to the following structure:

[
    {
    "field": "field1",
    "status": 1,
    "value": ["value1a"]
  },

  {
    "field": "field1",
    "status": 1,
    "value": ["value1b"]
  },

{
    "field": "field1",
    "status": 1,
    "value": ["value2c"]
  },

...

 

Can't seem to get the individual values in a single array.

Outcomes