cancel
Showing results for
Did you mean:
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
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

2 REPLIES 2
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

Frequent Visitor

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

Announcements

#### Back to Basics Tuesday Tip #9: All About the Galleries

This is the ninth post in our series dedicated to helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we feature new content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other!     Today's Tip: All About the Galleries Have you checked out the library of content in our galleries? Whether you're looking for the latest info on an upcoming event, a helpful webinar, or tips and tricks from some of our most experienced community members, our galleries are full of the latest and greatest video content for the Power Platform communities.   There are several different galleries in each community, but we recommend checking these out first:   Community Connections & How-To Videos Hosted by members of the Power Platform Community Engagement  Team and featuring community members from around the world, these helpful videos are a great way to "kick the tires" of Power Platform and find out more about your fellow community members! Check them out in Power Apps, Power Automate, Power Pages, and Copilot Studio!         Webinars & Video Gallery Each community has its own unique webinars and videos highlighting some of the great work being done across the Power Platform. Watch tutorials and demos by Microsoft staff, partners, and community gurus! Check them out: Power Apps Webinars & Video Gallery Power Automate Webinars & Video Gallery Power Pages Webinars & Video Gallery Copilot Studio Webinars & Video Gallery   Events Whether it's the excitement of the Microsoft Power Platform Conference, a local event near you, or one of the many other in-person and virtual connection opportunities around the world, this is the place to find out more about all the Power Platform-centered events. Power Apps Events Power Automate Events Power Pages Events Copilot Studio Events   Unique Galleries to Each Community Because each area of Power Platform has its own unique features and benefits, there are areas of the galleries dedicated specifically to videos about that product. Whether it's Power Apps samples from the community or the Power Automate Cookbook highlighting unique flows, the Bot Sharing Gallery in Copilot Studio or Front-End Code Samples in Power Pages, there's a gallery for you!   Check out each community's gallery today! Power Apps Gallery Power Automate Gallery Power Pages Gallery Copilot Studio Gallery