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

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

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,078)