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