Dimitar Grigorov
Dimitar Grigorov

Reputation: 85

ADF passing more than one array paramater to LogicApps

I have an issue rearding the passing of more than one array parameter. I was able to do a "for each" cycle to execute my array parameter "SPPATH", but unfortunately I can pass only one, here is my code:

{"SPPATH":"@{item()}","SPFOLPATH":"@{pipeline().parameters.SPFOLPATH}","updsppath":"@{pipeline().parameters.updsppath}","Storageacct":"@{pipeline().parameters.Storageacct}","sapath":"@{pipeline().parameters.sapath}","saoppath":"@{pipeline().parameters.saoppath}"}

enter image description here

I want to pass "updsppath" also in the array because my output is on different locations, is it possible to do that, if so, how?

thanks in advance

Upvotes: 0

Views: 630

Answers (1)

Rakesh Govindula
Rakesh Govindula

Reputation: 11234

I have reproduced the above and able to iterate multiple arrays inside ForEach.

For this the length of the all arrays should be same.

Use another array for indexes of these.

For Sample I have two array parameters like below.

enter image description here

I have created another array for index like below.

@range(0,length(pipeline().parameters.arr1))

enter image description here

Give this index_array to ForEach.

Create a res array variable in pipeline and inside ForEach, use append variable with the below dynamic content.

@json(concat('{"arr1":"',pipeline().parameters.arr1[item()],'","SPFOLPATH":"',pipeline().parameters.arr2[item()],'"}'))

enter image description here

After ForEach if you look at variable result (for showing here I have assigned to another variable), it will give you the desired JSON.

enter image description here

Result:

enter image description here

You can use this procedure to generate the desired array of objects and pass it to the logic apps as per your requirement.

Upvotes: 1

Related Questions