web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Trigger condition comparing column date with Modified date

(0) ShareShare
ReportReport
Posted on by 89

Hello,

 

I am trying to create a trigger condition for use on SharePoint's "When an item is created or modified" trigger but can't get it working.

 

The condition I want to test is if the date in a SharePoint list text column is equal to the date in the SharePoint's default Modified column.

 

Here is trigger condition I am trying: @equals(triggerBody()?['tiered'],triggerBody()?['Modified'])

 

Tiered is a text field in a SharePoint list and its value is set in a Power App using Text(Now(),ShortDateTime).

 

The SharePoint list Modified column is set to use the Standard Display Format.

 

When I view the list the columns match but the trigger condition doesn't seem to ever evaluate to true.

date-columns.png

So, I created to variables in my flow and set the values to using the Dynamic content values from the trigger:

 

variable-config.png

 

and I get 

 

variables.png

 

So, it appears that although they look the same when viewing the list, the values are actually different.  

 

I'm guessing I might need to format them so they look the same (I'll take any suggestions on how to do that) or perhaps I need to change my Tiered SharePoint column from text to date.

 

Can anyone please steer me in the right direction?

 

Thanks,

 

robertg

I have the same question (0)
  • abm abm Profile Picture
    32,585 Most Valuable Professional on at
    Re: Trigger condition comparing column date with Modified date

    Hi @rgentile 

     

    Not sure why the modified not showing the date only format?

     

    If you looking only the date to compare then you could do the following

     

    image.png

     

    Above I have two compose and formatDateTime() expressions. Following are the expressions I used.

     

    formatDateTime(variables('modified'),'yyyy-MM-dd')
     
    formatDateTime(variables('tier'),'yyyy-MM-dd')
     
    Here I have formatted both dates to yyyy-MM-dd format. Next step you can compare both values and implement the rest of the logic.
     
    Ideally I would use tier field as DateTime similar like modified. But the above logic could work as well.
     
    Here is my run result
     
    image.png
    Thanks

     

     

  • rgentile Profile Picture
    89 on at
    Re: Trigger condition comparing column date with Modified date

    Thanks for the reply and the code @abm.  Is there a way to add time to the date when I compare them?  I need to make sure the date and time match.   

     

    I was thinking perhaps my problem was related to the tier being a text field so thanks for confirming my thought that it could be part of the problem.  I appreciate your time and help.

     

    robertg

  • rgentile Profile Picture
    89 on at
    Re: Trigger condition comparing column date with Modified date

    I tried changing the Tiered column to a date format and the formats match.  But I see there is a bit of a time difference so I think it would always return false.  

     

    variables-same-format.png

    I'm thinking of trying to to determine if the times are within say a minute of each other rather than equal.  Sound reasonable?

     

    Thanks

  • Verified answer
    rgentile Profile Picture
    89 on at
    Re: Trigger condition comparing column date with Modified date

    I ended up determining the difference between the two dates and times.  But rather than do this in a trigger condition I just added a condition inside the Flow.  So if the time difference was 2 or less I sent the email, otherwise did nothing.

     

    This is the code to determine the difference:

    div(div(mul(sub(int(variables('modified')),int(variables('tiered'))),100),1000000000),60)
     
    Thanks again for the suggestion to use a date field @abm!
     
    robertg
  • abm abm Profile Picture
    32,585 Most Valuable Professional on at
    Re: Trigger condition comparing column date with Modified date

    Hi @rgentile 

     

    Yes thats the milli seconds difference. So if you want to ignore then use the format yyyy-MM-dd hh:mm:ss

     

    Thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard