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!

 

View solution in original post

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,587)