I just tried to export table data to csv, but the json field is not exported.
It's just empty field.
How can I solve this?
HI @Luan_Nascimento,
Great question β exporting tables with JSON or JSONB fields as CSV in Retool can be tricky because CSV is a flat format (no native support for nested objects/arrays) and JSON fields often appear empty if not stringified properly before export.
Before exporting, transform your data and JSON.stringify
any field that contains an object or array.
Example in Retool. Add a JS transformer/query (name it transformForExport)
// Transformer before export
return table1.data.map(row => ({
...row,
metadata: JSON.stringify(row.metadata)
}));
Then set your CSV export buttonβs data to {{ transformForExport.data }}