cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (54,601)