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 : OKNdRPiO+d5EsVmxPqwDlr
Power Automate - Building Flows
Answered

Not Equal to today

Like (0) ShareShare
ReportReport
Posted on 7 Nov 2022 15:47:19 by 551

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. 

  • joel914823 Profile Picture
    551 on 07 Nov 2022 at 18:48:22
    Re: Not Equal to today

    That worked, thank you both! @Pstork1 @ScottShearer 

  • Verified answer
    Pstork1 Profile Picture
    67,170 Most Valuable Professional on 07 Nov 2022 at 18:28:46
    Re: Not Equal to today

    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
    551 on 07 Nov 2022 at 18:25:13
    Re: Not Equal to today

    @Pstork1 I'm looking to exclude items created today

  • Pstork1 Profile Picture
    67,170 Most Valuable Professional on 07 Nov 2022 at 18:17:55
    Re: Not Equal to today

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

  • joel914823 Profile Picture
    551 on 07 Nov 2022 at 18:12:13
    Re: Not Equal to today

    @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)

  • ScottShearer Profile Picture
    25,236 Most Valuable Professional on 07 Nov 2022 at 18:07:06
    Re: Not Equal to today

    @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')'

     

  • Pstork1 Profile Picture
    67,170 Most Valuable Professional on 07 Nov 2022 at 17:56:17
    Re: Not Equal to today

    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

  • joel914823 Profile Picture
    551 on 07 Nov 2022 at 17:41:16
    Re: Not Equal to today

    @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
    67,170 Most Valuable Professional on 07 Nov 2022 at 15:53:14
    Re: Not Equal to today

    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.

     

  • ScottShearer Profile Picture
    25,236 Most Valuable Professional on 07 Nov 2022 at 15:52:42
    Re: Not Equal to today

    @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

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete