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 Automate
Answered

dayOfWeek not working

(0) ShareShare
ReportReport
Posted on by 139

Hi all,

 

I build a Flow where I check if the current day is a weekday. I do this with following code

 

dayOfWeek(body('Add_to_time_CurrentDay'))

 

 

However the value which I compose with dayOfWeek is returning me the number. I´m passing the value to a condition and check if the value is not equal to 6=Saturday or 0=Sunday.

 

Unfortunately every value is true, so the final result also include the weekend days.2020_07_24_11_21_39_adminrds_Remote_Desktop_Connection.png

Categories:
I have the same question (0)
  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    please @Belasor  try adding and expresion string with the numbers, instead the numbers in your condition. see

     

    ifstring.PNG

  • Belasor Profile Picture
    139 on at

    Unfortunately this is also not working with the same result.

  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @Belasor,

     

    The issue is caused by the logic in Condition action not correct.

    No matter which day of the week, it will return to the true.

    If the day of the week is 1-5, it will meet two conditions and return true;

    If the day of the week is 0, it will meet the second condition and return true;

    If the day of the week is 6, it will meet the first condition and return true.

     

    So if you want to determine the day of the week whether is weekend, please change the condition to And:

    Annotation 2020-07-27 103806.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Belasor Profile Picture
    139 on at

    Thank you for the answer. Unfortunately also this is not working

    error2.pngError.png

  • v-litu-msft Profile Picture
    on at

    Hi @Belasor,

     

    Please not use the string() function convert integer 6 and 0 to string "6" and "0", cause the return of dayOfWeek() function is an integer, different types couldn't compare:

    Annotation 2020-07-27 153642.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard