How can I get a an output file for each JSON iteration?
Question asked by Jonathan Olivier - 11/13/2021 at 6:16 AM
I have 5 JSON data sources mapped into a single JSON writer. Each of the JSON sources covers a specific element/array of the JSON writer schema.

How can I feed an array of files into the data source and get a single file for each iteration?  

I attempted to use "file list", but it just bundles them together. 

1 Reply

Reply to Thread
Liquid Support Replied
Employee Post Marked As Answer

It's slightly unclear what you are trying to do, I'm assuming you want to feed multiple files into a transform and get an output file for each input file, but I'm unclear about the 5 data sources? The following may help, but if you can provide more information (sample image input and outputs) then I can be more specific.

You can feed a sequence of files into the transform in a number of ways...

If you know the names of the files up front then you can add the file names in as constants and then combine them into a sequence, which you feed into your JSON reader. If you require an output file for each input file, then you can use the source filename to build the output filename (in the example if the input file is c:\Source1.json, the output would be c:\Source1.output.json - note GetFileName has an option to remove the extension).

If all of your source files are in one folder then you can use the ListFiles component to get a list of all the files in a folder, you can then use this to feed your transforms.

Reply to Thread