Queries

Global Variables

Javascript

Recent Posts

Archive

Query anything with SQL

You can query data from non-SQL sources via SQL. If your data isn't from a SQL database, it's probably an array of objects. Retool lets you use SQL to query your data as if they were tables in a database. That means you can query the results of a REST API endpoint, or Google Sheets data, all via SQL.

Writing a query to transform JSON objects

If you have your array of JSON objects handy (eg. in apiData.data), you can query it via a Query JSON with SQL resource:

Filtering an array of objects using SQL

It's not _exactly_ SQL

Since the data isn't actually stored in a postgres database, some SQL might not work. If something isn't working exactly as expected, here are the docs: