cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Doors1980
Helper I
Helper I

Restrict number of items in Gallery

I've got a pretty standard formula on the item of a Gallery:

 

SortByColumns(Filter(LLL, StartsWith(Title, TextSearchBox1.Text)), "Modified", If(SortDescending1, Ascending, Descending))

 

How would I modify this formula to further restrict the filtered results to only return a set amount of items from my SharePoint list? Say 100 items?

 

Cheers in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

You can use the FirstN function for that:

FirstN(
    SortByColumns(
        Filter(
            LLL,
            StartsWith(Title, TextSearchBox1.Text)),
        "Modified",
        If(SortDescending1, Ascending, Descending)),
    100)

View solution in original post

4 REPLIES 4
CarlosFigueira
Power Apps
Power Apps

You can use the FirstN function for that:

FirstN(
    SortByColumns(
        Filter(
            LLL,
            StartsWith(Title, TextSearchBox1.Text)),
        "Modified",
        If(SortDescending1, Ascending, Descending)),
    100)

You are the man @CarlosFigueira Nice one.

Can this technique  be used to retrieve data from a Large Sharepoint lists?

 

See https://powerusers.microsoft.com/t5/PowerApps-Forum/Help-with-Large-Sharepoint-List/m-p/66007#M27107

 

Thank you!

It should work; if all the functions that you use for filtering and sorting are delegatable (if they're not, there will be a blue icon indicating it), then it should work.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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