web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Set variable inside fo...
Power Automate
Unanswered

Set variable inside for each

(0) ShareShare
ReportReport
Posted on by 8

Hi to all, 

 

I'm currently trying to build a flow that basically sends a message and options in teams and in parallel sends out a reminder (do until) if the recipients have not yet selected an option. Because I have several recipients, I have a "for each" loop. Now I have to build this flow somehow so that it checks for each recipient whether an option has been selected and if not, sends the reminder (do until).

 

So far I have solved this by initializing a Boolean variable at the beginning. this is set to false. if an option (whether yes or no) is selected, the variable is set to true and the do until stops if the variable is true.

 

So far the flow runs successfully, even with the reminder. However, as soon as one of the recipients selects an option, the set variable overwrites all "for each" loops to true, so that my other recipients, who may not yet have selected an option and need a reminder, no longer receive one. the set variable action therefore changes the Boolean globally and not "for each".

 

How can I change this or what can I use instead of "set variable"?

 

As123_0-1713965485643.png

As123_1-1713965543220.png

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @A-s123 ,

     

    Please consider use Compose action instead of using variable in 'Appy to each'.

     

    Best Regards,

    Wearsky

  • A-s123 Profile Picture
    8 on at

    Hi @v-xiaochen-msft 

     

    thanks for your reply!

    I've thought about it, but I'm not sure how to use it since I'm using boolean values to change the state of the variables after an option is selected. I am still quite new to Power Automate and am trying to figure something out with some use cases on the www 😁 Do you perhaps have an example?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard