I have a Pagination group wherein it uses the Sequence function for page numbers in the pagination gallery. I also have a button at the end that shows the last page number that is selectable to go to that last page in the gallery. It all functions properly except for the select function, when selecting the last page number or even any page numbers greater than 4 it will throw the "Row or column passed to the select function is outside the bounds of the gallery items"
It's like it can only select the first 4 records in the gallery however I set the items property of the pagination gallery to be paginated as well e.g. 1 2 3 4 -> selects more -> gallery pagination items: 5 6 7 8.
On Select of next button:
UpdateContext({varSelectionNumber: RoundUp(CountRows(datasource)/2,0)});
UpdateContext({varPageNumber: RoundUp(CountRows(datasource)/2,0)});
ClearCollect(colCurrentSelection, LastN(FirstN(colPageNumber,4*varSelectionNumber), 3*1));
Select(galPagination, varPageNumber)
Items of pagination gallery:
If(varSelectionNumber=1, FirstN(colPageNumber,4*varSelectionNumber), LastN(FirstN(colPageNumber,4*varSelectionNumber), 4*1))