cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Doors1980
Level: Powered On

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
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Restrict number of items in Gallery

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
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Restrict number of items in Gallery

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

Doors1980
Level: Powered On

Re: Restrict number of items in Gallery

You are the man @CarlosFigueira Nice one.

SqueezeOJ
Level: Powered On

Re: Restrict number of items in Gallery

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!

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Restrict number of items in Gallery

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
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,816)