cdel
cdel

Reputation: 21

Creating a JSON structure in PDI without blocks

I'm trying to get a simple JSON output value in PDI from a field that was defined in an earlier step. The field is id_trans, and I want the result to look like {"id_trans":"1A"} when id_trans value is 1A.

However, when using the JSON Output step and setting the json bloc name to empty, I get this: {"":[{"id_trans":"1A"}]}, which is normal given that the JSON Ouptut step generates json blocks, as specified in the doc.

How can I get rid of the bloc ( i.e. []) structure in a simple manner? I thought of using an external python script, but I would rather use steps in PDI.

Upvotes: 2

Views: 1618

Answers (1)

Falco Winkler
Falco Winkler

Reputation: 1190

You can easily do that with another JSON Input step. Just specify your output value from JSON Output step as Select field and under the tab fields, specify a fieldname and data[0] as Path.

Upvotes: 1

Related Questions