I am currently working on implementing pagination in a gallery using Power Apps, but I am encountering an issue when I try to display data in pages. I am using the following formula on Items Property of Gallery:
LastN(
FirstN(
Filter(
'Purchase Requisition', // Your data source
// Approval Status Filter:
(
(CheckboxApproved.Checked && Status.Value = "Approved") ||
(CheckboxPending_1.Checked && Status.Value = "Pending") ||
(CheckboxRejected_2.Checked && Status.Value = "Rejected") ||
(!CheckboxApproved.Checked && !CheckboxPending_1.Checked && !CheckboxRejected_2.Checked)
) &&
// Status Filter
(IsBlank(varStatusFilter) || Status.Value = varStatusFilter) &&
// DateRange Filter:
(
(IsBlank(DatePickerCanvas1_1.SelectedDate) || 'Date of Requisition' >= DatePickerCanvas1_1.SelectedDate) &&
(IsBlank(DatePickerCanvas2_2.SelectedDate) || 'Date of Requisition' <= DatePickerCanvas2_2.SelectedDate)
) &&
// Price Range Filter
(
(IsBlank(txtInput_MinPrice.Value) || 'Price' >= Value(txtInput_MinPrice.Value)) &&
(IsBlank(txtInput_MaxPrice.Value) || 'Price' <= Value(txtInput_MaxPrice.Value))
) &&
// Search Box Filter
(
txtInput_Search_2.Value in ID ||
txtInput_Search_2.Value in 'Date of Requisition' ||
txtInput_Search_2.Value in 'Requisitioned by'.DisplayName ||
txtInput_Search_2.Value in Location.Value ||
txtInput_Search_2.Value in Department.Value ||
txtInput_Search_2.Value in 'Requisitioned by'.DisplayName ||
txtInput_Search_2.Value in Status.Value ||
txtInput_Search_2.Value in 'Approved by'.DisplayName ||
IsBlank(txtInput_Search_2.Value)
)
),
varRowsPerPage * varPage // Get the first N records based on page and rows per page
),
varRowsPerPage // Only show rows for the current page (limit to 10 per page)
)
but I still cannot display the data as expected.
This type of post provides context for your error, details about what you’ve tried so far, and specific questions that can guide others in the community to help you troubleshoot.