I want to use a pipline ADF to call an API REST which used an sql table and extracts one or more files.
API should return 3 files if the table contains 3 different regions, for this reason I used the following activities:
A lokupctivity : it's a query ( distinct on the column Regions) to get all the regions present in my table. ---------> the result :
"value": [{"RegionCode": "10" },{"RegionCode": "60"},{"RegionCode": "50"}],`
EachActivity(Check_Region_In_Table) :to call my API for each Region
In your ForEach, use the expression with
item().RegionCode
to refer the lookup column value.@concat('{"sourceTable": "table","query": "select * from table where RegionCode="', item().RegionCode,'","outputFileType" : "csv","optionList":"nullValue=null|delimiter=\t|header=false","outputFolder":', item().RegionCode,'file-{YYYY}-{MM}-{dd}-{HH}-{mm}-{ss}.txt"}')