Using the Json writer to create a Json for each record

Answered

Comments (2)

  • Avatar
    admin
    Hi there,

    I believe that you can indeed achieve your goal by using the JSONWriter component. The component, however, assumes that it is intended to create one JSON file from all records (from the whole data flow). In order to tell the component that you need one result for each row, you might want to set the "Records per file" attribute to 1. This way, the JSONWriter creates a separate JSON file for each record.

    If you then use the output port writing function (you can use the discrete option now), the component will send a list of JSON strings to the output port, where each row corresponds with each original record. The result on the edge looks like this:

    CaptureJson.PNG
    I have created a graph for your review (I am including input data that the graph uses). Please take a look. I hope this meets your needs, but if not, please let me know.

    Best Regards,
    Eva
    0
    Comment actions Permalink
  • Avatar
    bea95

    Hi there,

    I believe that you can indeed achieve your goal by using the JSONWriter component. The component, however, assumes that it is intended to create one JSON file from all records (from the whole data flow). In order to tell the component that you need one result for each row, you might want to set the "Records per file" attribute to 1. This way, the JSONWriter creates a separate JSON file for each record.

    If you then use the output port writing function (you can use the discrete option now), the component will send a list of JSON strings to the output port, where each row corresponds with each original record. The result on the edge looks like this:

    CaptureJson.PNG
    I have created a graph for your review (I am including input data that the graph uses). Please take a look. I hope this meets your needs, but if not, please let me know.

    Best Regards,
    Eva

    "jandikovae"



    Thank you Eva,

    That was exactly what I was looking for!
    0
    Comment actions Permalink

Please sign in to leave a comment.