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
Unanswered

Not Equal to today

(0) ShareShare
ReportReport
Posted on by 557

Im trying to filter query for get items from sharepoint so that it does not get items that are equal to today.

 

The format when it pulls from sharepoint is as such.   

"Created":"2022-11-07T12:06:55Z"

How can I write the filter query to it excludes those items, I've tried to format in the expression but with no luck.  Thank you. 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @joel914823 

    Try this for your filter query:

    Created lt 'formatDateTime(utcNow(), 'yyyy-MM-dd')'

     

    Obviously, the formatDateTime() expression must be entered inside of the expression window.

    image.png

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Because it includes the time component you can't really use equals.  What you need to do is provide a range. Test it for Created is less that today at midnight and Created is greater than yesterday at midnight.

     

  • joel914823 Profile Picture
    557 on at

    @Pstork1 Thank you that makes sense on the range vs. equal.  Pardon my lack in knowledge but how do I put today at midnight and yesterday at midnight?  your guidance is appreciated.

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    The easiest way is to use a Compose and populate it with Yesterday at Midnight (which is today at 00:00).  Then another Compose to AddDay(midnight,1) to it for today.  Here's a screenshot of an example

    image.png

  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @Pstork1 @joel914823 

    If the objective is to exclude items that were not created today, I believe that the expression that I posted above will work (time zone not withstanding).

    Created lt 'formatDateTime(utcNow(), 'yyyy-MM-dd')'

     

  • joel914823 Profile Picture
    557 on at

    @ScottShearer Hi Scott - thanks for your reply.  I tried that but it still included it in the get items output.  It may be that utc now its taking into consideration at that moment the flow runs vs a range of time (best guess)

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    I may have read it wrong.  I thought he was trying to include only the items created or modified today.

  • joel914823 Profile Picture
    557 on at

    @Pstork1 I'm looking to exclude items created today

  • Verified answer
    Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Then Scott is right that you only need the less than.  But I would still use the Compose to get the full dateTime in ISO8601 format for midnight. In my experience the comparisons don't work correctly if you aren't using full ISO 8601 format.  So try it with the first Compose I had in my screenshot and set Created lt that compose value.

  • joel914823 Profile Picture
    557 on at

    That worked, thank you both! @Pstork1 @ScottShearer 

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard