Retool XLSX Export Error: “Invalid array length” with Large Dataset (~50k rows)

Hi everyone ,

We’re currently building an internal tool using Retool (Cloud version), and I’ve run into an issue I’d really appreciate help with.

My goal:
Export a full table (~52,000–53,000 rows) to XLSX format using Retool’s built-in table export functionality — no custom JS involved.

Issue:
I’m querying data with a simple statement:

SELECT * FROM "VB_Tarif2"

The table is bound via:
{{ queryTBL3.data }}

The table loads correctly with all rows (around 52k), displaying a valid array of objects:

[
{
"Internal_code": "AAA F00 9455",
"Code1": "87459941784123",
"Code2": "AAA F00 9455XX"
},
...
]

When using the XLSX export option from the table’s toolbar, I receive the error:
“Invalid array length”

The issue only occurs with XLSX, and only when exporting the full dataset.
It works fine when:

I use CSV export

I filter the table down to ~14,000 rows or fewer

Steps I've taken to troubleshoot:
Confirmed the table binds correctly and loads a valid array (no computed columns, no JS).

Verified the same table export works when reduced to ~14k rows.

Checked Retool documentation and searched the forums — no clear answers about XLSX limits or this specific error.

Additional info:

Retool version: Cloud

User permissions: Logged in as Admin

Data source: Internal Retool database

Export method: Standard table export button (no custom logic)

Screenshots or screen recording: Happy to provide if needed

Could you help clarify:
Are there known limits (row count, memory, size, etc.) for XLSX export in Retool?

Do you know whether this “Invalid array length” error is triggered client-side, from the Retool backend, or related to Excel constraints?

Is there a best practice or workaround for exporting large datasets (50k+ rows) to XLSX reliably?

Let me know if more context would help — I’m happy to share logs, samples, or screen recordings.

Thanks so much in advance for your time and insights!
:grinning:

Dario

Hey @DarioG,

Thanks for creating this topic! I see that you already discussed this over email with our team. For visibility on the forum, this appears to be a common restriction of XLSX. Our internal engineering team confirmed that the Invalid array length error is triggered client-side, and it's not something from our backend.

Did you end up implementing a workaround?

Hello @Tess, thanks for getting back to me!

Based on what the engineering team confirmed, it seems that XLSX exports are best suited for smaller datasets, typically under 500,000 total cells (rows × columns). Once that threshold is exceeded on the client side, it can lead to issues like the “Invalid array length” error I encountered.

In contrast, CSV exports handle larger datasets without problems, making them a more reliable option for exporting high-volume data.

Here are a couple of potential workarounds we’re exploring:

  • Splitting the export into multiple XLSX files to stay within size limits
  • Setting a row limit specifically for XLSX exports, while keeping CSV available for full exports

Would be great to hear if others have found effective solutions or if there are any best practices recommended by the Retool team for managing large XLSX exports.

Appreciate the support!

1 Like