Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JoeFields
Frequent Visitor

How to limit OnTake to 100 rows in Custom Connector

I am trying to implement Table.View with a REST API but the API has a limit of 100 items per call. I saw PQ trying to fetch 200 items at a time which caused errors so I modified the OnTake handler as below but now it loads 100 rows and then has an error on row 101. I suspect this is because it is still trying to fetch 200 rows but only getting back 100 but how do I override the max number of rows requested?

 

OnTake = (count as number) => let newState = state & [Top = (if count > 100 then 100 else count)] in @View(newState),
3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @JoeFields,

I'd like to suggest you take a look at following link about use power query handling pagination api if helps:

Handling paging for Power Query connectors - Power Query | Microsoft Learn
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hello Xiaoxin, we are implementing paging already in our connector which works well but it is downstream from the OnTake so this would not resolve the issue. It appears that OnTake is set to receive a default of 200 items per page and there is not a clear way to override this default to a different value. If I cap OnTake to 100 results, we get errors because it is expecting 200 results.

HI @JoeFields,

I'd like to suggest you filter on the output result to limit the result amount instead of the directly overwrite the parameters. (current power bi data connectors does not include any writeback features)

So if these properties can't be configured/defined in the API request, it may means you also can't customize them at power bi desktop side.

Regaerds,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.