cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Lukas1
Level: Powered On

How to use variables in loop / workaround

Hi,

 

apparently it is not possible to change the value of a variable in an "apply for each" loop.

 

How can it be done? Is there any workaround?

 

Thanks,

Lukas

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: How to use variables in loop / workaround

You can't Initialize a Variable in a loop, but you can change the value using Set Variable or Increment Variable inside a loop.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: How to use variables in loop / workaround

You can't Initialize a Variable in a loop, but you can change the value using Set Variable or Increment Variable inside a loop.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Community Support Team
Community Support Team

Re: How to use variables in loop / workaround

Hi @Lukas1,

 

It could be changed as soon as the input is an array, whatever you enter it manually or put in dynamic content from previous steps.

Annotation 2020-01-10 154208.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Lukas1
Level: Powered On

Re: How to use variables in loop / workaround

@Pstork1 , you are right, thanks!

It didn't work when I had the Set variable already in the flow and moved it into the loop (drag and drop). Creating new Set variable functions directly in the loop solved the problem.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (6,819)