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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
cabbagekumquat
Frequent Visitor

Connecting to a API (Repsly) through Power Query DataFormat.Error: We reached the end of the buffer

Hello,

I am trying to get a list of active products from an API. With the help of this post I was able to get to the code posted below. 

However on row 1302 (it should load 1311 active products) i get an error: DataFormat.Error: We reached the end of the buffer. Filtering out the error in query does nothihg. The table does not load.

 

What is this error and how do I get arounf it? Any help or direction towards the solution is greatly appreciated.

 

let
    Final = List.Generate
    (
        ()=>
        [
            Result= Json.Document(Web.Contents("https://api.repsly.com/v3/export/products/0", [Headers=[Accept="application/json"]])),
            TotalCount = 1
    

        ],
        each [TotalCount]>0,
        each 
        [
            
            Result= Json.Document(Web.Contents("https://api.repsly.com/v3/export/products/" & Text.From([Result][MetaCollectionResult][LastID]), [Headers=[Accept="application/json"]])) ,
            TotalCount = [Result][MetaCollectionResult][TotalCount]
           

        ],

        each [Result][Products]
    ),
    FinalTable = Table.FromRecords(List.Combine(Final)),
    #"Filtered Rows" = Table.SelectRows(FinalTable, each ([Active] = true)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Packaging", "ImageUrl", "MasterProduct"}),
    #"Removed Errors" = Table.RemoveRowsWithErrors(#"Removed Columns", {"Code"})
in
    #"Removed Errors"

 

 

2 REPLIES 2
lbendlin
Super User
Super User

The string size limit is 32K.  you seem to have run into that limit.

Thank you so much for your answer! So I figure I need to "trim" what I recieve? I figure the way to go now would be to either:

1. split the call into two queries

2. call just the active products from API (not filter them later in the query)

3. call just the necessary columns (not delete them later in the query)

 

The furthest I got is with the "Active":null,  but everywhere I though to put it did not work. This are the help dictionaries which I have a very hard time putting to use: 

https://repsly-dev.readme.io/reference/products

https://api.repsly.com/v3/help/#Export%20products 

 

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.