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 / Optimize flow with mul...
Power Automate
Suggested Answer

Optimize flow with multiple conditions.

(1) ShareShare
ReportReport
Posted on by 64
The flow:
         I've written a flow that triggers when a form is submitted (Forms for Excel). The flow sends an email notification to the planner to create a work order for the part number and quantity provided in the form. The form also asks for a department, and this is what determines which planner receives the notification. In the Teams group for the planners, I have an excel workbook with a table of the departments, planner's name, and planner's email. The flow is composed of a bunch of conditions that verify which department is selected in the form response and to generate an email notification if true. I have a condition for each department (See image).
 
My question: Is there a more succinct way of writing this flow, or am I on the right track by having conditions for each department? I think it works fine for the number of departments that I'm working with, but I couldn't imaging writing out each scenario for a more complicated, or much larger communication chain. 
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at
    Hi,
     
    Another way to try this is using OData filter query in List rows in table action, like filtering based on deprtment and then using the resultant data to get email id and send email see below for better idea
     
    Assume this is the excel table
     
    Now in the List rows present in table action, use below odata filter query to filter the excel table data with department column value
    Note - the column name used in Odata filter query shouldn't have spaces, else it will fail (only issue with excel actions)
     
    Now based on output of above actions, you can create condition action like below
    Expression used- 
    length(outputs('List_rows_present_in_a_table')?['body/value'])
     
    Now this expression checks whether there is any output from list rows in table action, if not it means such department value entered in form does not exists, else it is present.
     
    if it is present, it will follow Yes branch as shown below to send email
    Expression used above to capture email id - 
    first(outputs('List_rows_present_in_a_table')?['body/value'])?['Planner Email']
     
    Here i have used outlook connector to demonstrate sending email - but the logic is same :)
     
    overall flow looks like
     
    Now you don't need to create condition for every department as it is not best practice.
     
    for more details on Odata filter query for usage in List rows in table action - refer below
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard