cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtagliaferri
Resolver I
Resolver I

Get Items Filter Query Date Range

I have a Get items which retrieves item with a date range of one year backwards, this works fine with the latest item as it will go back one year form the date, however if I modify an old item the filter will retrieve all items one year old plus the newer ones.

I have a variable RefDate to set date -1 Year

RefDate

addDays(triggerOutputs()?['body/StartDate'],-365,'yyyy-MM-dd')

 

Screenshot 2021-04-29 at 05.31.58.png

 

 

What approach should I have to limit the filter to only items that are between StartDate and RefDate rather than anything that is greater than RefDate and also include the Staff filter?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, the above does return no record, but you gave me the hint on how to add data to the formula with the brackes. I realised that all items will have a startDate, so I cretated a second variable refStart which is the StartDate of when the item is created.

so the formula is now:

Staff eq <'staff'> and (StartDate ge 'refDate' and StartDate le refStart)

 

And it works.

 

Thanks @Achavan for the hint!

 

View solution in original post

2 REPLIES 2
Achavan
Resolver II
Resolver II

Staff eq '<staff'> and ( StartDate ge 'refdate' and StartDate lt 'refdate')

 

Hope this work!

Hi, the above does return no record, but you gave me the hint on how to add data to the formula with the brackes. I realised that all items will have a startDate, so I cretated a second variable refStart which is the StartDate of when the item is created.

so the formula is now:

Staff eq <'staff'> and (StartDate ge 'refDate' and StartDate le refStart)

 

And it works.

 

Thanks @Achavan for the hint!

 

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 (2,101)