Hi,
I'm having trouble formatting my json output to how we need it.

A line of our input looks like this:
{ "id":"4068837", "last_name":"SMITH", "first_name":"JOHN", "age":"17", "sex":"M", "occ":"TLR", "destination":"USA"}

After getting transformed, we want the output for this line to look like this (broken up for easier viewing but should be all in one line):
{"attributes":
[{"value":"SOMER","type":"_LAST_NAME"},{"value":"JOHN","type":"_FIRST_NAME"},{"value":"17","type":"_AGE"},
{"value":"M","type":"_GENDER"},{"value":"TLR","type":"_OCCUPATION"},{"value":"U","type":"_LITERACY"},
{"value":"USA","type":"_DESTINATION"}
],
"last_modified":"05 Aug 2012",
"id":"24-4068837",
"items":
[{"id":"24-4068837-0","type":"record","amount":null,"category":"document","title":"Arrival Date","date_str":"05 Aug 2012"}
]
}

I tried nesting multiple JSON output steps together to deal with each Json object and trying to knit it together into a Json array like below. I have two Json output steps hopping to one Json output step. If I disable one of the hops, everyone plays nicely. If both hops are enabled, I get an error with my transformation.

The "Show error lines" won't let me cut and paste so I've attached a screenshot but the short description is
Unexpected error, KettleException: The specified field '{0}' could not be found in the input...at JsonOutput.processRow(JsonOutput.java:209),...at RunThread.run(RunThread.java:50)

Attached is my transformation file, screenshot of the transformation, and a screenshot of the "Show error lines" screen.
Any help is greatly appreciated. Thanks in advance.
concat_multiple_json_p.ktr


Name:  pentaho_transform.jpg
Views: 489
Size:  8.2 KB


Name:  pentaho_error.jpg
Views: 478
Size:  48.9 KB