When you're running large queries in Google Sheets with Supermetrics, you might encounter this error:
- Fetching data failed: Error processing results, result set is too large: Array length 50000000 exceeds supported capacity limit
This error happens because Google Apps Script — which Google Sheets uses to perform functions like moving data into a sheet — has a set limit on how much data it can move at once. You'll see the error message if the dataset your query creates is larger than the array limit of 52,428,800 bytes (50MB).
This limitation exists within Google Sheets, so it can't be fixed using Supermetrics. However, creating queries that return less data will lower the likelihood that the error occurs.
Optimize your queries
Follow these steps to optimize and lighten your queries. A shorter date range, fewer metrics and dimensions per query, and splitting big queries into several smaller ones are good starting points.
You can also use the "Combine new results with old" feature to create queries that only pull the last 7 days, for example, while keeping as much historical data as you need available in the same sheet.