web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Paging and Filtering -...
Power Apps
Unanswered

Paging and Filtering - dataset

(0) ShareShare
ReportReport
Posted on by 482

Hi everyone - hoping I can get some help with a paging/filtering issue I have. Basically I'm trying to create a dataset control that loads the next page as you scroll, but it's not working when I change the filter - for instance I expected 18 records returned, but it's not returning any (see image below for dataset output).

skoofy5_0-1605229687860.png

 

Essentially I've got an event that fires when you scroll and it hits the last record it will then fire loadNextPage(). This works fine when I load it up and when I search the control it's only when changing the filter that the dataset consistently returns no records.

 

If I load up all the records in the updateView method at the start then the filtered view loads fine.

 

if (context.parameters.DataSet.paging.hasNextPage) {
   context.parameters.DataSet.paging.loadNextPage();

return;
}

I have the same question (0)
  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @skoofy5 , 

     

    Not very sure if I get it right, since I'm not sure how you search and how you filter.

    In my PCFs I've used loadExactPage instead of loadNextPage, so it might be different, but I had a similar issue there: when the user was searching, I had to move back to the first page, otherwise I didn't get the data.

    In my case I've used dataset.paging.loadExactPage(1), but in your case the 

    dataset.paging.reset()

    could work too (since it resets to page 1). After that I had to call the data dataset.refresh() too.

    Hope this helps!

     

    Kind regards,

    Diana

     

    PS: Just in case you wonder, I know loadExactPage is not documented, so basically unsupported, but as @ScottDurow showed in his blog https://develop1.net/public/post/2020/05/07/pcf-dataset-paging-in-mode-vs-canvas-apps, there aren't much options for implementing for both model-driven and canvas apps. 

     

  • skoofy5 Profile Picture
    482 on at

    Thanks, Diana. I have seen some info from Scott earlier about loading an exact page, but I was pretty happy to have the cumulative dataset that got returned with loadNextPage. I've tried your other suggestions with no success, unfortunately, so I'll try loadExactPage next.

    The repro steps are:

    1. Load initial dataset with multiple pages.
    2. Hit loadNextPage at least once and have additional pages to load.
    3. Filter the dataset (with records expected to be returned of course) and no records will exist in the returned dataset, but the total result count will be the total expected to be returned (as my image shows in the first post).

    skoofy5_1-1605490766613.png

    If you then clear and apply the filter again the records are returned in the dataset as expected.

    This issue does not occur if you follow the repro steps above, but then before you filter you search or if the page size is large enough and loads all the records. It also does no occur subsequently if you swap between views with the same control applied.

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @skoofy5 , 

     

    I can confirm that following your repro steps, I get the same error.

    So it's not because of loadNextPage or loadExactPage. Actually has nothing to do with our code. 

     

    It happens only when you use the "Advanced Filtering panel", like in your screenshot above, but doesn't happend when you just type something in the search box.

    Actually is not happening only with 3rd party PCFs, but also with the out of the box grids. You can use the ribbon "Show As" -> "Read only grid", and test the standard. It's exactly the same behavior.

     

    I've checked what fetchXML is send in the background by the platform.

    If I use the search box (which works), I see the following fetchXML in the network protocol:

    <fetch version="1.0" mapping="logical" returntotalrecordcount="true" page="1" count="25" no-lock="false">
    <entity name="orb_pcftester">
     <attribute name="orb_ampel"/><attribute name="orb_prio"/><attribute name="orb_optionsetcode"/><attribute name="statecode"/><attribute name="orb_pcftesterid"/> 
     <attribute name="orb_name"/><attribute name="createdon"/>
     <order attribute="orb_name" descending="false"/>
     <filter type="and">
     <condition attribute="statecode" operator="eq" value="0"/>
     </filter>
     <filter type="or" isquickfindfields="1">
     <condition attribute="orb_name" operator="like" value="impo%"/>
     </filter>
    </entity>
    </fetch>

    If I use the "Advanced Filtering Panel", I see the similar fetch, but page "2", and that's the reason for not finding records:

    <fetch version="1.0" mapping="logical" returntotalrecordcount="true" page="2" count="25" no-lock="false">
    <entity name="orb_pcftester">
    <attribute name="statecode"/><attribute name="orb_name"/>
    <order attribute="orb_name" descending="false"/>
    <attribute name="modifiedon"/><attribute name="orb_optionsetcode"/><attribute name="orb_prio"/><attribute name="orb_ampel"/><attribute name="orb_pcftesterid"/>
     <filter type="and">
     <condition attribute="statecode" operator="eq" value="0"/>
     <condition attribute="orb_name" operator="like" value="Impo%"/>
     </filter>
    </entity></fetch>

     

    I hope the product team can help us. 

    Maybe you can open a support ticket, since the bug can be reproduced with out of the box grids.

     

    Kind regards,

    Diana

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hello @HemantG ,

     

    It seems that there is a bug with "Advanced Filtering Panel" search, which doesn't reset the page when the filter is changed. The last 2 messages in this thread are showing the repro and the paging issues. It happens to standard grids too.

    Is the product team already aware of this? I'm not sure if it's a PCF or a Dynamics bug. Maybe we should report it somewhere else?

     

    Kind regards,

    Diana

  • Hemant Gaur Profile Picture
    Microsoft Employee on at

    Ack, we will review and update the thead. It seems this is a bug,

     

    hemant 

  • skoofy5 Profile Picture
    482 on at

    Any updates? I've posted another issue in regards to linking/adding columns that seems to create a similar issue when filtering.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 408

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 319

Last 30 days Overall leaderboard