Can someone suggest a data format for SQL results?
My goal is to store data in the format below when data is returned from a SQL query. Section and Label are column names.
[
{ section: "Orders", label: "New Order" },
{ section: "Orders", label: "Order List" }
]
Welcome to the community, @rtulachan! I think I understand what you're asking, but please correct me if I'm off base. By default, Retool returns the results of most SQL queries as an object where each key is the column and the associated value is an array of individual records.
This isn't always the most intuitive, but you can easily tell Retool to reformat it using the query's built-in transformer and the formatDataAsArray function.