Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

How to compare the existing date with the 6 months date ?

(0) ShareShare
ReportReport
Posted on by 10

Hi All,

 

I am trying to create the reminder notification with the existing data in the SharePoint List.

 

I have a Column with the name 6 Months Review Date, how to compare it with the existing date?

I am struggling with the expressions and conditions, I have created the flow it works fine but the output is not accurately what I want?

 

Can anybody guide me?

Please see the flow below,

 

Hasham_Khalid_0-1713428019363.png

 

  • David_MA Profile Picture
    David_MA 9,039 on at
    Re: How to compare the existing date with the 6 months date ?

    For it to work, dates MUST be formatted with the ISO8601 format: yyyy-MM-dd

     

    ISO - ISO 8601 — Date and time format

  • Chriddle Profile Picture
    Chriddle 7,375 on at
    Re: How to compare the existing date with the 6 months date ?

    When comparing strings (and dates are strings just in a special format), they compared from left to right.
    Therefore your most significant character (here the millennium) must be on the left side.

    Your formatDateTime function creates a string with the day on the left side.

     

    Why are you even using formatDateTime?

  • Andrew_J Profile Picture
    Andrew_J 1,962 on at
    Re: How to compare the existing date with the 6 months date ?

    @Hasham_Khalid 

     

    @David_MAhas said the dates need to be in ISO8610 format, which is yyyy-MM-dd.  Yours are not in that format.  Perhaps you can change and re run your flow.

     

    Andrew

  • Hasham_Khalid Profile Picture
    Hasham_Khalid 10 on at
    Re: How to compare the existing date with the 6 months date ?

    Hi,

     

    I used the same date format in both conditions for comparison.

     

    formatDateTime(item()?['OData__x0036_MonthlyReview_x002f_Date'], 'dd/MM/yyyy')

    is greater than 

    formatDateTime(addDays(utcNow(),184),'dd/MM/yyyy')

     

    Can these 2 conditions work?

     

     

  • David_MA Profile Picture
    David_MA 9,039 on at
    Re: How to compare the existing date with the 6 months date ?

    The dates on both sides of the condition need to be formatted using ISO8610 format, which is yyyy-MM-dd. If you do that, it should work.

  • Andrew_J Profile Picture
    Andrew_J 1,962 on at
    Re: How to compare the existing date with the 6 months date ?

    @Hasham_Khalid 

     

    Can you give me a for instance i.e. an example.

     

    6 Months Review Dateexisting date
      

     

    I understand the compaison but without dates i.e. 18/04/2024 in a table form and some real world data I cannot help much further as I need to go away and model some information to make sure I am providing the correct advice. 

     

    Andrew

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard