cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chandru
Frequent Visitor

PowerApps PCF Control setPagesize Issue

Hi 
   Now I am working on an app with PCF control. This PCF control nothing but an ag-grid with SQL data. I am using Powerapps SQL connection to get data for AG-Grid. Also, I was set the Data limit to 2000 in settings. In PCF Code, I am using paging.setPageSize method to set the page size per refresh.Though that method returns more than 2000 records. How is it get more than 2000 records?

Even I am using Powerapps SQL server connection with a threshold limit of 2000. 

context.parameters.gridData.paging.setPageSize(5000)


Thanks
4 REPLIES 4
cwebb365
Super User
Super User

May I ask where you put this code to change the page size? Where does that line go? Can I get the section it was set. Really struggling to find info and if I can get more records than the current 25 I’d be estatic! 

cwebb365
Super User
Super User

I kind of figured it out. It works! However if I go over like 200ish it will stop rendering if you scroll down the page. Selecting selects them but something is up with rendering. Do you have the same issue? Thinking it might be height setting related going to mess with that and see if I can’t figure it out.  

cwebb365
Super User
Super User

Ok, so rendering issue seems to be control height related or something, cause it my main app it works fine. But I did discover the fix for your issue I think, or at least I have a clue. I was having the same issue with the data being pulled and performance bad. If you set your sort on your primary key to the table the performance is very fast. I beleive, the issue might be it's defaulting to a column with the sort as mine was and performance was poor as it was pulling and sorting a lot more records. I happen to notice this cause my id column was skipping by 3's. I switched sort to id column and it is very performant now. Not sure how this will work if you need to sort on other columns thou, but paging with sort on certain columns seems to be where the performance issue there lies. Hope this helps if you haven't figured it out yet! 

cwebb365
Super User
Super User

@Chandru I had same issue with other columns, when the first column was not indexed, it would pull way more data than needed and slow. I added a Non clustered Index to my view I'm using for the grid, and it's now instantly loading on a sort. Just go in and add some indexes and you should be golden. 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,091)