Search code examples
c#quickbase

Maximum number of bytes in report exceeded Error while using API do_query in Quickbase


I am using QBApiWrap.QuickbaseApiWrapper.DoQuery in C# to get the records from my table. Previously it has been working fine. Now the number of records have increased to 30,000 and I am getting the following error:

Errcode : 75

Errtext : Report too large

Errdetails : Maximum number of bytes in report exceeded

How can I get all the records in a single dataset?

I am querying in below manner:

     DataSet dsEmployee = My_Integration.QBApiWrap.QuickbaseApiWrapper.DoQuery(dbIdEmployee, ticket, "","3.6.7.8.21.15");

Solution

  • Quickbase has a record limit on the size of a single response which your query is exceeding. To avoid this error, you need to reduce the number of records being returned by the query. If you aren't actually using all of the returned records in your program, you should structure your query so that you exclude records that you aren't using. If you do, in fact, need all of the records in that table you'll need to download them in batches and then merge the datasets.

    Unfortunately, I've never programmed C# so I can't help you with the syntax, but to download records in batches you can use API_GetSchema on your table DBID to get the next record id (table.original.next_record_id). This number is what the record ID will be for the next record to be created. So, you know that all of your record IDs are less than that number. Using a lower bound of 0 and an upper bound of 20,000 you can query for records where the record id is greater than the lower bound and less than the upperbound. Merge the results with an existing dataset, increase both bounds by 20,000 and repeat until the lower bound exceeds the next record id number. At the end you should have a single dataset and code that should scale with your Quickbase table.