Home > OS >  call an forEachActivty from a body Json of an webActivtity
call an forEachActivty from a body Json of an webActivtity

Time:04-20

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 enter image description here

  • 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"}')
    
  • Related