Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage

(0) ShareShare
ReportReport
Posted on by 78

Hello Power Platform Community,

 

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)
)
 

Issue:

Whenever I try to use this formula, I get an error message: "We didn't find any data." The data source appears to be correct, and I have set up the context variables on "OnVisible" property of Screen

UpdateContext({varPage: 1, varRowsPerPage: 10});

 but I still cannot display the data as expected.

 

What I’ve Tried:

 

  1. Double-checked the context variables (varRowsPerPage and varPage).

  2. Verified the filter conditions to make sure they aren't causing the issue.

  3. Tested the data source without pagination to ensure data is being loaded correctly.

  4. Ensured that varRowsPerPage and varPage are correctly initialized and updated.
 

Any help or suggestions would be greatly appreciated!

 
 

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.

  • WarrenBelz Profile Picture
    148,805 Most Valuable Professional on at
    Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    148,805 Most Valuable Professional on at
    Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage
    The bottom filter is on _Data (the output of the top one)
     
  • SR-02111122-0 Profile Picture
    78 on at
    Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage
    Right now I have 17 records 
     
  • WarrenBelz Profile Picture
    148,805 Most Valuable Professional on at
    Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage
    So the filter works on its own (as per what I posted last) and the pagination and search also work on their own ? How many records do you have ?
    LastN(
       FirstN(
          Filter(
             'Purchase Requisition',
             Len(txtInput_Search_2.Value) = 0 ||
             txtInput_Search_2.Value in Text(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
          ),
          varRowsPerPage * varPage
       ),
       varRowsPerPage
    )
     
  • SR-02111122-0 Profile Picture
    78 on at
    Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage
    After applying the formula it's not showing any error but before pagination filters were working fine.
  • WarrenBelz Profile Picture
    148,805 Most Valuable Professional on at
    Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage
    They are your filters - I simply copied them and split out the Delegable portion at the top. What happens if you put this in a Gallery Items
    Filter(
       'Purchase Requisition', 
       (
          (
             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
          )
       ) &&
       (
          IsBlank(varStatusFilter) || 
          Status.Value = varStatusFilter
       ) &&
       (
          IsBlank(DatePickerCanvas1_1.SelectedDate) || 
          'Date of Requisition' >= DatePickerCanvas1_1.SelectedDate
       ) &&
       (
          IsBlank(DatePickerCanvas2_2.SelectedDate) || 
          'Date of Requisition' <= DatePickerCanvas2_2.SelectedDate) &&
       (
          IsBlank(txtInput_MinPrice.Value) || 
          'Price' >= Value(txtInput_MinPrice.Value)
       ) &&
       (
          IsBlank(txtInput_MaxPrice.Value) || 
          'Price' <= Value(txtInput_MaxPrice.Value)
       )
    )​​​​​​​
  • SR-02111122-0 Profile Picture
    78 on at
    Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage
    After applying this formula my Pagination is working but my filters are not working only search is working
  • WarrenBelz Profile Picture
    148,805 Most Valuable Professional on at
    Error 'We Didn't Find Any Data' for Formula Using varRowsPerPage * varPage
    You are correct that the pagination basic structure is the proper format, so
    LastN(
       FirstN(
          'Purchase Requisition',
          varRowsPerPage * varPage 
       ),
       varRowsPerPage
    )
    will work fine, however (assuming you are using SharePoint here), you will only retrieve content from the first rows set by your Data Row Limit. Firstly, try this
    With(
       {
          _Data:
          Filter(
             'Purchase Requisition', 
             (
                (
                   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
                )
             ) &&
             (
                IsBlank(varStatusFilter) || 
                Status.Value = varStatusFilter
             ) &&
             (
                IsBlank(DatePickerCanvas1_1.SelectedDate) || 
                'Date of Requisition' >= DatePickerCanvas1_1.SelectedDate
             ) &&
             (
                IsBlank(DatePickerCanvas2_2.SelectedDate) || 
                'Date of Requisition' <= DatePickerCanvas2_2.SelectedDate) &&
             (
                IsBlank(txtInput_MinPrice.Value) || 
                'Price' >= Value(txtInput_MinPrice.Value)
             ) &&
             (
                IsBlank(txtInput_MaxPrice.Value) || 
                'Price' <= Value(txtInput_MaxPrice.Value)
             )
          )
       },
       LastN(
          FirstN(
             Filter(
                _Data,
                Len(txtInput_Search_2.Value) = 0 ||
                txtInput_Search_2.Value in Text(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
             ),
             varRowsPerPage * varPage
          ),
          varRowsPerPage
       )
    )
    Next, if that does not work, delete the filters and then add them back in one at a time until it breaks - you should then find the culprit. Lastly if that all fails change your controls back to Classic controls and see if that fixes the issue.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1