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 / Filter Query in MS Flow
Power Automate
Answered

Filter Query in MS Flow

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello

 

I'm trying to filter 'Get Items' via Filter query by a field name called 'Roster_Date', basically I intend to retrieve any entries with Roster_Date less then 20 days from now. 

 

Expression picked up right date, but output isn't correct. Basically its pull all the entries in the SharePoint list. Ideally output should be about 100 items or even less.

My Flow Snapshot:

MS Flow_5.JPGlist. 

 

Appreciate if you could pin point where the mistake is please .

 

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Filter Query Expression I had used is :

    Roster_Date le formatDateTime(addDays(utcnow(),-20),'MM-dd-yyyy')

  • Verified answer
    v-litu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    What's the type of the Roster_Date column?

    If it is a string column, it couldn't be compared as Date. When Flow run, they are compared as two numbers, for example:

    two numbers 04-22-2019 and 03-22-2020, 04-22-2019 will greater than 03-22-2020, cause 04 is greater than 03.

    The workaround is to change the Roster_Date column into a Date column. Or change the Roster_Date column's format to "yyyy-MM-dd", then filter query change into Roster_Date le formatDateTime(addDays(utcnow(),-20),'yyyy-MM-dd')

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-litu-msft Roster_Date is of type 'Date/Time'

     

     

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 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard