How to use foreach activity parameters inside the if activity which is inside foreach i passed the values to the if condition like if true it will perform an activity but if false it had to use the values of the failed condition. but in the false condition i had to copy the false activity filenames to other location but in the filename option how to get parameters which are passed from the foreach activity
CodePudding user response:
Usually to get the current item in the iteration, you use item()
in dynamic expression under ForEach iterator
section in Add dynamic content
tab
However, when you try to find it inside an activity i.e. past 2nd level of hierarchy
It is not listed!
Workaround:
Just inside of Foreach
activity, use set variable activity to store the current item in iteration to a variable. Then reference this variable in further activities.
Example:
Simple ForEach activity
with input array param
IfCondition
activity inside ForEach
activity. Assign current item to a variable var
of type String
For case true
it performs some activity eg: wait
For case false
it performs a copy activity
Query: Select * from Persons where city = '@{variables('var')}'