Everyone I'm trying to copy files from two different tables from postgres database, for which I created two datasets, one linked service, one output dataset (parametrized folder name,filename)
step1: My Pipeline is connecting a lookup table which contains column rownumber,lookup e.g. lookup column values ['output1','output2']
step2: I used an iterator (Foreach Activity) to fetch lookup array items
step3: changing data type array items
step4: switch activity, expression if foreach item value match with let's say 'output1' then it will execute copy operation and fetch file from one table and will place in output location which will also dynamically create a folder 'output1' and will dump copied file with name output.csv.
but it seems all operation is running fine only second case from switch operation is not working. It Seems i couldn't find any reason why is it not copying to second location, if condition is false
here is the expression I've used for switch operation:
@if(equals(variables('var'),'output1'),'True','False')
I have also reproduced the similar scenario as you and its working fine. Till switch activity your all the values and pipeline is correct. the issue you are facing with copy activity may be.
As per you ask you want to copy from two different datasets to one folder with two subfolders.
To achieve that you need to specify dynamic content correctly:
logs
folder under that it will createOutput1
folder and under that it will place theoutput.csv
file with expression@concat('logs/',variables('string'))
.I used similar sink for second copy activity also just changed the source as per requirement.
Execution:
Output:
copy from two different datasets to one folder with two subfolders.