Dev Payroll Tracker
which contains over 1 lakh records. In the Power Apps dashboard:- I have a Gallery connected to this list.
- It uses pagination (Next & Previous buttons).
- It has filters:
- Buttons: "
My Records","
Pending"
, "Completed"
, "All"
- Search bar (TextInput)
- Region (Radio control)
​​​​​​​
- Buttons: "
Expected Behavior: The gallery should:
- Show newest records first (sorted by
Created
) - Filter by button values [
My Records
,Pending
,Completed
,All
], region, and search - Load 100 records per page
- Work reliably even with over 10,000 matching records
Set(varPageNumber, 1);
Set(varPageSize, 100);
Set(varGalleryFilterMode, "All");
Now, in the Dashboard Screen there is four Buttons:Completed Button:
Set(varGalleryFilterMode, "Completed");
Set(varCurrentPage, 1);
Set(varGalleryFilterMode, "Pending");
Set(varCurrentPage, 1);
Set(varGalleryFilterMode, "My");
Set(varCurrentPage, 1);
Set(varGalleryFilterMode, "All");
Set(varCurrentPage, 1);
If(
CountRows(
Filter(
'Dev Payroll Tracker',
Switch(
varGalleryFilterMode,
"Completed", Status.Value = "Completed",
"Pending", Status.Value = "Pending",
"My", 'Created By'.Email = User().Email,
true
),
IsBlank(Radio1.Selected.Value) || Region.Value = Radio1.Selected.Value
)
) > varPageNumber * varPageSize,
Set(varPageNumber, varPageNumber + 1)
)
Pagination Previous Button:
If(varPageNumber > 1, Set(varPageNumber, varPageNumber - 1))
Pagination Label text:
"Page " & varPageNumber & " of " &
RoundUp(
CountRows(
Filter(
'Dev Payroll Tracker',
Switch(
varGalleryFilterMode,
"Completed", Status.Value = "Completed",
"Pending", Status.Value = "Pending",
"My", 'Created By'.Email = User().Email,
true
),
IsBlank(Radio1.Selected.Value) || Region.Value = Radio1.Selected.Value
)
) / varPageSize,
0
)
Gallery1.Items property:
With(
{
filteredData:
Sort(
SortByColumns(
Filter(
'Dev Payroll Tracker',
// 🔹 Status
Switch(
varGalleryFilterMode,
"Completed", Status.Value = "Completed",
"Pending", Status.Value = "Pending",
"My", 'Created By'.Email = User().Email,
"All",true,
true
),
// 🔹 Region
IsBlank(Radio1.Selected.Value) || Region.Value = Radio1.Selected.Value,
// 🔹 Search
IsBlank(TextInput1.Text) ||
StartsWith('Processor Name'.DisplayName, TextInput1.Text) ||
StartsWith(Month.Value, TextInput1.Text) ||
StartsWith(ProcessName.Value, TextInput1.Text) ||
StartsWith(Region.Value, TextInput1.Text) ||
StartsWith('Request Type/Subtask', TextInput1.Text) ||
StartsWith('Request ID / Emp ID', TextInput1.Text)||
StartsWith('Requestor Email',TextInput1.Text)||
EndsWith('Processor Name'.DisplayName, TextInput1.Text)
),
"Created", SortOrder.Descending
),
Modified, SortOrder.Descending
)
},
FirstN(
DropColumns(
LastN(
filteredData,
CountRows(filteredData) - ((varPageNumber - 1) * varPageSize)
),
ID
),
varPageSize
)
)
Thanks in advance!