cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joshparry73
Frequent Visitor

Filter powerapp data from sharepoint list by created by date

I'd like to display a gallery in Powerapps based on any items added in the last 7 days.

I'm trying to use a filter

Something like this

 

Filter([@'Making a Difference Awards'], "Created">= -7,Descending)

 

I need help knowing how to get the last 7 days from the list.

6 REPLIES 6
mdevaney
Super User III
Super User III

@joshparry73 

You can use the DATEADD function to subtract 7 days from the current date.  See my code below.

 

Filter([@'Making a Difference Awards'], Created>= DateAdd(Today(),-7,Days),Descending)

 

Link to MS Docs for DATEADD

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff#:~:...

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thanks for your help.

I'm getting a delegation warning using this code.

@joshparry73 

Yeah... dates do not yet have the ability to be delegated in SharePoint.

https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

So are you saying I can't do what I'm hoping to do ... yet?

@joshparry73 

Date delegation is coming (supposedly).  We have to find workarounds in the meantime...

 

If your number of results are not expected to exceed the delegation limit of 2,000 you could use this code instead.  There will be delegation warnings but you can safely ignore them.

Filter(
    Sort(
        [@'Making a Difference Awards'],
        Created,
        Descending
    ),
    Created>= DateAdd(Today(),-7,Days)
)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

@joshparry73 

Did I answer your question here?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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