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 / Condition Comparing Da...
Power Automate
Answered

Condition Comparing Dates is Always Resulting True

(0) ShareShare
ReportReport
Posted on by 44

Hi All,

I have a flow scheduled monthly to send an email if an item in a list has a due date within the next 34 days (ie next month). However, when I run the flow, it results true for every item, even those with due dates months from now. Any idea what I am missing?

AAallday_0-1611770306937.png

 

"isTrigger":false,

"operationName": "Condition", "operationDefinition":

{"type":"If","expression":
{"and":[
{"lessOrEquals":["@formatDateTime(outputs('Compose'),'yyyy-mm-dd')","@addDays(utcNow(),34,'yyyy-mm-dd')"]},
{"or":[{"equals":["@items('Apply_to_each')?['Status/Value']","Pending"]},{"equals":["@items('Apply_to_each')?['Status/Value']","Delayed"]}]}]},
"actions": {"Send_an_email_(V2)": {"type":"OpenApiConnection",

"inputs":{"host":{"connectionName":"shared_office365","operationId":"SendEmailV2","apiId":"/providers/Microsoft.PowerApps/apis/shared_office365"},

"parameters":{"emailMessage/To":"email@address","emailMessage/Subject":"test","emailMessage/Body":"<p>aasdfasdfasdf</p>"},"authentication":"@parameters('$authentication')"},

"runAfter":{}}},

"runAfter":{"Compose":["Succeeded"]}}}

Categories:
I have the same question (0)
  • Verified answer
    tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @AAallday ,

    can you add 2 Compose actions just before the condition, put @formatDateTime(outputs('Compose'),'yyyy-mm-dd') into one of them and @addDays(utcNow(),34,'yyyy-mm-dd') into the other? You'll then see in the run history what dates enter the condition and if it should return true/false.

    Also, the date format you use ('yyyy-mm-dd') is not right. Lowercase 'mm' = minutes. For months it must be upper case 'MM'. The format should be 'yyyy-MM-dd'.

  • AAallday Profile Picture
    44 on at

    Looks like this works -- thank you! and thank you for the formatting catch!

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard