maybe somebody has a solution or can tell me if this is a bug or not. This is my scenario:
I am getting items from a SP list based on a filter. The read values are evaluated in an apply to each. A switch is used to determine the column and based on that a value form the list is assigned to a variable or sometimes a calculation is done and the result is then assigned to the variable.
The first run with the first value is correct. In the second value everything is correct except the variable. Even though it is assigned the correct value to the variable, when I create an item in this apply-to-each, the value from the variable is the value form the first variable.
Any help or input is greatly appreciated.
I noticed that the four actions in Apply_to_each seem to be independent, so how do you configure "Set variable 4"?
If you set the same value for the variable in "Set variable 4", then the value of the variable will be the same for each execution of Apply_to_each.
I want to know which branch of the "Create item" action is configured, or after which conditions are met, the action is executed.
I am thinking that the value stored in the variable is not what you expected, probably because the value of the variable has been rolled back to the value set for the first time in the configuration of a step.
The value of a variable is always changing, depending on the context in which it is located and the context in which the action is used.
Which may involve the step of reassigning, which will change the value of the variable and act on the action below the same branch.
"set variable 4" was a random help variable, which is not used in this context.
I know what you mean with : "I am thinking that the value stored in the variable is not what you expected, probably because the value of the variable has been rolled back to the value set for the first time in the configuration of a step."
But the variable is set inside the "apply-to-each", based on a column which changes in "apply-to-each." I have the switch, that checks the value from "apply-to-each" and assigns the correct information to the variable, which should be then used, as it is not changing in that loop. It changes again in the next loop, the next value from "apply-to-each".
I took screenshots from a run:
could you please let me know the feasible solution for this of how to change variable value from the fixed as mentioned in your reply to as per the for each loop.
i am using 4 for each loops and in the second for each loop i have set the variable. while seeing the data its resetting back as you said to the first value.
could you please let me know what is the solution for this
i found the solution for this . please disable the concurrency control if there are any variables used in your flow and multiple for each loops are used.
ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
Find your favorite faces from the community presenting at the Power Platform Community Conference!