Hello,
When I initialize the variable "Montant_Actuel" it automatically goes into a foreach loop, and then when I save my WorkFlow it gives me an error telling me that a variable cannot be initialized in a foreach loop.
The value I give to my variable is a value that comes from one of my SharePoint lists.
How do I remove my variable from the foreach loop?
Thanks in advance !
Hi @s44 ,
You would want to check what type of column is "Montant_Actuel" in the SP list?
If it is an array and something that can hold multiple values, the PowerAutomate flow automatically generates an ApplyToEach loop. In which case you will have to initialize your variable as an array.
OR
If you know the column always holds a single value then you can "initialize variable" before the loop and then use a "Set variable" action inside the loop as shown below.
Note: You can only use set variable inside a loop and not initialize inside a loop.
Thanks and Regards,
Vikas K