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 / Calendar based condition
Power Automate
Suggested Answer

Calendar based condition

(0) ShareShare
ReportReport
Posted on by 2
I have built a flow which runs with no errors flagged, but doesn't actually do the action it is designed to do, and I feel that it is the condition that is causing it to fail, but I cannot find a fix for it.
 
To summarise current flow
Trigger: When a new email is received
Condition: date contains Monday or Wednesday or Saturday or Sunday,
If true: reply to email (with body text about it being a non-working day)
If false: no action.
 
The run report comes back all green, no errors found. But also no-one is getting an out of office reply either.
This would be much easier if outlook just had this built in when you set your working hours, but as they don't can anyone help me fix the condition?
Categories:
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    Can you show screenshot of the condition and the expression you have on it?  If you are just checking the receivedDateTime to contain "Monday" for example then it will most likely never met the condition since the receive time doesn't have the names of the days. You need to convert that datetime value to day of the week.

    Use dayOfWeek() -expression to check what day of the week. And have it be OR so it checks if today is either 1, 3 or 6 which are Monday, Wednesday or Saturday



    Expression is the same in all the rows: 
    dayOfWeek(triggerOutputs()?['body/receivedDateTime'])

    Equal to

    1 = Monday, 3 = Wednesday, 6 = Saturday

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data.dayoftheweek?view=exchange-ews-api


    Since the flow is starting right away when the email comes you could also use dayOfWeek(UtcNow()) since it should be the same as the email received date
  • Michael E. Gernaey Profile Picture
    53,429 Super User 2025 Season 2 on at
     
    What @eetuRobo says is completely legit, but I do have a follow up question.
     
    You made it sound like everything runs as if the True side gets run but no one gets the emails.
    So essentially your condition is working, that is how I read it, but if that is true, then the issue is with the reply email action and not with your condition.
     
    So as @eetuRobo mentioned, what we really need to see is the RUN itself, with the actions Opened, so we can see what you put in.
     
    I hope
    a) this helps explain the confusion so next time it will :-) be clearer easier
    b) how easy it is to have the smallest thing barf your work, but you have to remember to share it all to get better help.
  • IW-29050937-0 Profile Picture
    2 on at
    Thanks @eetuRobo I had tried a version previously that had AND days of week, OR days of week, and also the numbers for the days of week. It was still doing the same thing, running finding no errors but taking no action.
    I think I've stumbled onto a fix by making it a recurrence instead of a condition (switching the order round) so the flow now runs on the selected days of the week, for all emails in coming, and my sent folder is full of messages so I think it has worked.
     
    Thanks @Michael E. Gernaey yes it was confusing me that it seemed to check all the conditions, but then always decide on false, therefore take no action but also report no error in the flow.

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