EDIT - I just saw your latest post - you seem to be asking this question.
Firstly all the responses above cover indexing numbering your gallery up to your maximum Power Apps
Data Row Limit of 2,000 (this is not a SharePoint Limit), but you may be asking a different question here (if not, disregard this post). You refer to
Delegable and this is a bit of a double-edged sword. Using
@Kalathiya's example: -
If the the top filter inside the
With() statement is Delegable, then it will action directly in SharePoint and (for example) if the filter was just this without the numbering
Sort(
'Business Service Orders', //Replace with your SharePoint list name - Apply filter here if needed
Created,
SortOrder.Ascending
)
it would return any number of records to the gallery, however the With() function actually creates a (very) temporary local variable and the output is subject to your Data Row Limit. So in essence, the query inside the statement (if Delegable) runs to SharePoint (the list can be of any size), however the returned records are capped at your Data Row Limit. So essentially if you are returning less than 2,000 records, all is well, but if you are expecting more, you are only going to get (the first) 2,000 numbered records back.
The fundamental issue is that you cannot Delegate anything outside the filter to SharePoint (this includes adding/renaming columns and a number of other things), so it has to be done locally after the records are returned, and therefore subject to your Data Row Limit.
Depending on whether you can "split" your filter into more than one Delegable query (all under 2000 records), you may be able to achieve this by "stacking" collections. As an example if you had two (you can do more) products
Blue and
Red, each under 2,000 items, you could do a Collection
With(
{
_Data1: Filter(
SPList,
Product = "Blue"
),
_Data2: Filter(
SPList,
Product = "Red"
)
},
ClearCollect(
colProducts,
_Data1,
_Data2
)
)
and then your Gallery
Items
ForAll(
Sequence(CountRows(colProducts)),
Patch(
Index(
colProducts,
Value
),
{RowIndex: Value}
)
)
Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
Visit my blog Practical Power Apps LinkedIn