cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nikola_bgd
Advocate II
Advocate II

Items from last 3 months

Hi, 

 

I'm trying to get SharePoint list items from the last 3 months from a column called DueDate. I'm trying with this formula in the filter query, but it's not working.. (items are not from last 3 months).

 

DueDate ge '@{formatDateTime(startOfMonth(getPastTime(3,'Month')),'MM-dd-yyyy')}' and DueDate lt '@{formatDateTime(startOfMonth(utcNow()),'MM-dd-yyyy')}'

 

Any ideas anyone?

1 ACCEPTED SOLUTION

Accepted Solutions
Rhiassuring
Super User
Super User

Ah great! Then, the above formula should work for you. I used it in the Filter Query field of my Get Items action - you'd just replace ReviewDate with DueDate. Let me know how it goes.

View solution in original post

4 REPLIES 4
Rhiassuring
Super User
Super User

Hi there, 


Just to be super clear: are you looking for the last 90 days, or the last 3 months - and does that "last 3 months" include this month? (This month, last month, the month before, in full?) 

I tried out this formula, and it brought back the dates of January 1st to April 1st. 

 

ReviewDate ge '@{startOfMonth(getPastTime(3,'Month'))}' and ReviewDate lt '@{startOfMonth(utcNow())}'


These are the dates on my list - and it only retrieved two of them - so it did it correctly:

 

Rhiassuring_0-1650080688261.png

 

Are you able to tell me - if your flow triggered on April 15th, what is the earliest date you would expect to see?

 

Cheers,

 

Rhia

 

Hey, thanks for helping out! 

90 days or 3 months, basically it doesn't make a lot of difference, any of the two would be good. 

Last 3 months include this month.

Rhiassuring
Super User
Super User

Ah great! Then, the above formula should work for you. I used it in the Filter Query field of my Get Items action - you'd just replace ReviewDate with DueDate. Let me know how it goes.

This works 🙂 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (3,711)