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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Expression with Or and If condition

(0) ShareShare
ReportReport
Posted on by 443

Hallo,

i am trying to write an expression but i keep messing this up..

 

I want the expression to check in a recurrent flow, whether today is Monday Or Tuesday.

I initiate 2 variables 

if(equals(dayOfWeek(utcNow()),1),true,false)
if(equals(dayOfWeek(utcNow()),2),true,false)
 

So if it is Monday or Tuesday then skip weekends since i want a reminder to be sent after 48 hrs from a specific Date.

I am not sure how to write an expression that uses both 'equals' 'or'.

 

If(or(equals(variables('var_isTuesday'),(variables('var_isMonday'),true),'This is true','This is false')

 

my first attempt was the following but it is not working.

if(equals(variables('var_isMonday'),true),addDays(formatDateTime(utcNow(),'yyyy/MM/dd'),-4),if(equals(variables('var_TodaysDay'),2),addDays(formatDateTime(utcNow(),'yyyy/MM/dd'),-4),
addDays(formatDateTime(utcNow(),'yyyy/MM/dd'),-2)))

I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Expression with Or and If condition

    Hi @marial16 

     

    Here's some alternatives for you to try:

    contains('12',string(dayOfWeek(utcnow())))
    contains('MonTue',formatDateTime(utcnow(),'ddd'))
     
    Both of which check the sting to see if the value exists and returns true or false.  Note that it is case sensitive and hence why I have MonTue.
     
    Alternatively based on your idea:
    OR(equals(dayofweek(utcnow()),1),equals(dayofweek(utcnow()),2))

    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts. Thanks
     
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at
    Re: Expression with Or and If condition

    @marial16 

    Hi there.  So, the OR() needs a complete expression inside each comma, so to fix what you've got already, the expression might look more like this:

    If(
     equals(
     or(
     equals(
     variables('var_isTuesday'),
     true
     ),
     equals(
     variables('var_isMonday'),
     true
     )
     ),
     true
     ),
    'This is true',
    'This is false'
    )

     

    @DamoBird365 's option will probably be quicker, and you can also use a condition:

    edgonzales_0-1653406266535.png

    So many great choices.

     

    Keep us posted!  Good luck!

    -Ed

     

    If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

     

  • PrajaktaAgte Profile Picture
    5 on at
    Re: Expression with Or and If condition

    nice one really , helped me

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 647 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 350 Moderator

#3
developerAJ Profile Picture

developerAJ 256

Last 30 days Overall leaderboard