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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Multiple If conditions
Power Automate
Unanswered

Multiple If conditions

(0) ShareShare
ReportReport
Posted on by 77

Hello. I'm new to power Automate.
I have multiple conditions in a flow.
I can't use a switch because I need to compare against a range.

Can anyone help me with a better way to do this flow?

 

The rule is that I need to calculate how many days an employee can take to complete a training. 

After this I use a Send Email V2 to inform the employee about the due date

 

If it is 35 to 40 hours it takes 7 days

If it is 25 to 35 hours it takes 6 days

If it is 20 to 25 hours it takes 5 days

If it is 10 to 20 hours it takes 4 days

If it is  0 to 5 hours it takes 2 days

 

Thank you very much

 

multcondtns.pngcndtnsdtls.png

Categories:
I have the same question (0)
  • Verified answer
    alex_mcla Profile Picture
    92 on at

    Hi @lauratn 

     

    You can use filter array. The flow is:

     

    Screenshot 2022-07-23 085444.png

    Where Number is the number of hours.

     

    I've only put the first two items in the Compose. You'll need all your conditions.

     

    Then, you need to filter the array.

    Screenshot 2022-07-23 085743.png

    Outputs is outputs('Compose')

     

    You need advanced mode to enter the expression: 

    @and(greaterOrEquals(triggerBody()['number'],item()?['min']),less(triggerBody()['number'],item()?['max'])) 

     

    Note; I've used less rather than lessOrEqual to ensure there is only one match for bounds 10-20 and 20-25 for example.

     

    Finally 

    Screenshot 2022-07-23 090102.png

    first(body('Filter_array'))?['days']
     
    @DamoBird365 has a great blog post on that you might also find helpful If, Else If, Else in Power Automate Simplified - DamoBird365.
     
    If this helps, please could you mark as solved.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard