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 / Expression with Or and...
Power Automate
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)))

Categories:
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    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

    @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

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard