Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Filter Query in MS Flow

(0) ShareShare
ReportReport
Posted on by

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 .

 

 

 

  • Community Power Platform Member Profile Picture
    on at
    Re: Filter Query in MS Flow

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

     

     

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: Filter Query in MS Flow

    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
    on at
    Re: Filter Query in MS Flow

    Filter Query Expression I had used is :

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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow