Hi,
There are a few ways, here is just one.
0. Create and Initialize an string. I suggest adding headers to it, so that it has the format you want AND has headers already (using commas separation) plus add a carriage return (using the encode
here is agreat article, I know it talks about removing them using this, but it is also the way to add them.
So the 0 line of code will be the headers + an expression adding the carriage return to the same string
1. You are going to need to create an Apply to Each with the input being Doc Main
Inside the Apply to each
a. Do a Get items from the DRS docType using the Seq number you get from the current loop of step 2.
b. add a Condition
In the left side put the expression length('insert the body value from step a')
middle make is equal too
right 1
This way you can check if you found the 1 record
in the yes side
c. use an Append to string, adding in all the fields from the Outer current Loop and the inner Current Loop together and also using the decode etc to add the carriage return
When all of the looping is done, you will have a single string that has all the rows in it in a CSV format.
Now you can use Create File using the String Variable
Done
If this helps you please mark as the answer