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 Platform Community / Forums / Power Automate / Get items date filter ...
Power Automate
Unanswered

Get items date filter query

(0) ShareShare
ReportReport
Posted on by 26

Hello everyone,

 

I’m building a simple flow used to count items in a SharePoint list depending on some criteria’s, mainly date fields.

I know there are a lot of posts on how to do it but somehow, I cannot make it work.

 

My flow is a scheduled trigger flow set to run in beginning of every month.

 

I then have a get items, followed by a variable in which I store the result of “@{length(outputs('request1')?['body/value'])}” to count the number of items coming from the get items action.

 

Everything works, except the most important part of the flow: this filter query. I have a date field named “Date de cloture” and I want to get every item in which the date field date is in the last month. For example, if I trigger it now, I want all the items where the date in “Date de cloture” are in February.

 

I beg you guys to help me on this one, I don’t understand what I’m doing wrong.

 

Thanks for your time !

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,693 Most Valuable Professional on at

    There isn't a Month() function available when doing OData queries in Power Autoamte. So you'll need to test the column value against a range.  For example if I wanted to check for items modified this month I could use the following.

    (Modified ge '2024-03-01') and (Modified lt '2024-04-01') 
  • Seb_ Profile Picture
    26 on at

    Would this work as a filter query ?

    Whats would be my options to make this dynamic so I can run the flow everymonth and get the correct result ?

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

    If you want it to use the current month you can calculate the start of this month and next month in the OData query like this.

     

    (Modified ge '@{startOfMonth(utcNow())}') and (Modified lt '@{startOfMonth(adddays(startOfMonth(utcNow()),31))}') 

     

    The start of the next month is the tricky one because you need to get the start of the current month, add 31 days to it and get the start of the month for that calculated date.

     

    The other option is to supply the start and end date in the trigger since its a manual triggered flow.

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 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard