Hi @RobinHan
Good point.
Approach 1:
You can do this approach, but this has a delegation limit
Previous button
UpdateContext({varRecord:First(Filter(Sort(MyDataSource,ID,SortOrder.Descending),ID < varRecord.ID))})
Next Button
UpdateContext({varRecord:First(Filter(MyDataSource,ID > varRecord.ID))})
Approach 2:
Get the next/previous item by Created date. This will not work if your items are created in bulk at the same time
Previous Button
UpdateContext({varRecord:First(Filter(Sort(MyDataSource,ID,SortOrder.Descending),Created < varRecord.Created))})
Next Button
UpdateContext({varRecord:First(Filter(MyDataSource,Created > varRecord.Created))})
Approach 3:
You can have a helper column that is a number type. Everytime you patch, you patch a sequential number in that column. This will not have the delegation warning. Let say we call our helper column Sequence.
Previous Button
UpdateContext({varRecord:First(Filter(Sort(MyDataSource,ID,SortOrder.Descending),Sequence < varRecord.Sequence))})
Next Button
UpdateContext({varRecord:First(Filter(MyDataSource,Sequence > varRecord.Sequence))})