Pentaho

 View Only

 JSON output via Modified JavaScript value step

  • Pentaho
  • Kettle
  • Pentaho
  • Pentaho Data Integration PDI
Ritesh Kumar's profile image
Ritesh Kumar posted 10-20-2019 16:45

Hi - I am using Modified JavaScript value step to create json objects . I can't use JSON output step as my json structure is nested.

 

Now I want to dump all these individual json objects into a file into an array. Output should look like:-

 

[

{"id":1,"name":"John"},

{"id":2,"name":"Kumar"},

{"id":3,"name":"Maria"}

]

 

I went through the blog post https://diethardsteiner.github.io/pdi/2014/08/10/Pentaho-Data-Integration-Nested-JSON-Structure.html but couldn't figure out the final solution myself.

 

Could anyone take a look at it and help me here?

 

Regards,

Ritesh

 


#Pentaho
#PentahoDataIntegrationPDI
#Kettle
Andrew Cave's profile image
Andrew Cave

Hi Ritesh.

You can use the JSON step but with a different JSON Path search string

 

$.*.id

$.*.name