Support Questions

Find answers, ask questions, and share your expertise

Jolt transform nested json array

New Contributor

How can I break and flatten nested JSON with arrays using Jolt transformations

from:

 

 

 

{
  "product": [
    "data - 1",
    "data - 2"
  ],
  "Purchase": [
    2,
    2
  ],
  "Renewal": 1
}

 

 

 

 

to

 

 

 

 

[
  {
    "product": "data -1",
    "Purchase": 1,
    "Renewal": 1
  },
  {
    "product": "data -2",
    "Purchase": 2,
  }
]

 

 

 

 

My current jolt transformation doesn't give me fully accurate transformation

 

 

 

 

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "*": {
          "@": "[#2].&2"
        }
      }
    }
  }
]

 

 

 

 

0 REPLIES 0