
Announcements
When using the scroller withour applying any filters it all works well.
However, when I apply filters based on the Country selected from the dropdown list, if the country is not available on the current page of the tables, it gives blank records.
I want to apply the pagination for the modern table in PowerApps dynamically on the size of the filtered dataset (Selection of a country). i.e. after the country filter is applied and not before that.
Currently the table is applying pagination (VarCurrentScroll and VarNextScroll) before filtering the collection for the selected country and scroll logic needs to be applied after filtering the entire collection.
If no selection it should show all records as per the pagination control.
The Record_No is tied to the unfiltered dataset (ColLocalMasterSPList), so when I filter for a country, its relevant record might not fall within the currently paginated range (VarCurrentScroll and VarNextScroll) which then gives a blank record page.
Item property of the modern table:
With({
FilteredCollection: Filter(
ColLocalMasterSPList,
IsBlank(drpFilterCountry.Selected.Country.Value) ||
Country.Value = drpFilterCountry.Selected.Country.Value
)},
Filter(
FilteredCollection,
CountRows(Filter(FilteredCollection, Record_No <= VarNextScroll)) > VarCurrentScroll
))
Next Button Logic:
Set(VarCurrentScroll, Min(VarCurrentScroll + 10, CountRows(FilteredCollection)));
Set(VarNextScroll, Min(VarNextScroll + 11, CountRows(FilteredCollection)));
Previous Button Logic:
Set(VarCurrentScroll, Max(VarCurrentScroll - 10, 0));
Set(VarNextScroll, Max(VarNextScroll - 10, 10));