cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Leslie
Frequent Visitor

Algorithm Logic Help: IF statement

Greetings PowerAutomate Community, 

I have a SharePoint list with seven (7) columns, each with checkbox inputs that can be selected by users. If any two (2) or more of these seven (7) checkboxes are selected simultaneously and saved to the list, an email notification needs to be triggered. I am using PowerAutomate to build the email notification. 

For the life of me, I cannot quite figure out an elegant way to represent the trigger statement (any two or more items selected out of seven) using IF/ELSE/AND statements in PowerAutomate. I am adamantly sure that I'm missing something blindingly obvious, and it's driving me nuts!

My logic so far:

Mathematically, selecting 2 from 7 would amount to a combination, as the order in which the items are chosen does not matter. Using the combinatorics formula, we have 7C2 = 7! / 2! x (7 - 2)! = 21. Meaning there are a MINIMUM of 21 different ways that can lead to the email getting trigged. This doesn't account for all of the cases when MORE than two (2) items are selected. 

My question:

Is there a way to count selections on checkboxes on the fly, so that the trigger can easily coded in? A counter variable trigger on > 2 would be the most obvious way to get it done in a programming language, but I'm stuck in PowerAutomate. 

Grateful for any help that can be provided. 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
ManishJain
Solution Sage
Solution Sage

Hi @Leslie ,

 

If the aim is to check 2 out of 7 , create a variable to hold the count of checked questions and at the end check for this variable to trigger email 

 

Thanks

View solution in original post

2 REPLIES 2
ManishJain
Solution Sage
Solution Sage

Hi @Leslie ,

 

If the aim is to check 2 out of 7 , create a variable to hold the count of checked questions and at the end check for this variable to trigger email 

 

Thanks

View solution in original post

Hi @ManishJain , I wasn't even aware that variables could be used in PowerAutomate! Thank you for enlightening me! 😀

 

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,337)