'JSON NESTED STRUCTURE - PENTAHO

I have this following json nested structure that i need to construct in pentaho:

{
  "num_matricula": "4242424",
  "limit_date": "2018-01-01",
  "admission_date": "2018-01-01",
  "cost_center": "anywhere",
  "pos_number": "pos-test",
  "role": "b63e065f-d7e0-49e1-91b7-88f74516e3fe",
  "department": "bf559996-a8b9-4f5e-af57-86111b0dbde3",
  "pagamento": {
    "vinculo": "clt",
    "valor": "4200",
    "recorrencia": "mensalista",
    "contaBancaria": {
      "banco": "001",
      "carta": "c9160763-db6c-4e8c-a1ad-ad8709c99be2"
    }
  },
  "deficiencia": false,
  "jornada": "De segunda a sexta das 15 as 19",
  "profile": {
    "name": "John Doe",
    "email": "[email protected]",
    "mobile": "11911111111"
  },
  "exame": {
    "clinica": "6dc84ce4-7d9f-48ec-b9b1-a8a895a21fd4",
    "data": "2018-01-01",
    "hora": "14:00",
    "obs": "Comparecer de manhã",
    "guia": "e37dab24-c7a4-4b92-b9d1-32ed538b8300",
  },
  "docs": ["c9e26093-5e0c-4bd2-bea3-ac5182a6179f"],
  "send_sms": true,
  "send_email": true
}

All the values come from the step "Select Values" which one gather the columns and the values to construct the json structure how it is showed in the following screenshot:

enter image description here

I've seen some solutions about using JavaScript to construct nested json structure in Pentaho, but i was not so sure about to create this using values from other steps. Can someone help me to construct this in pentaho? Pleasee.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source