Retool Query JSON with SQL

Querying JSON with SQL is a way to use SQL to query JSON data. This can be useful if you have a large amount of JSON data that you need to query. I will show you how and when to use this resource query in Retool.

 

When you can use it?

You can use it if you have to query

  • Manipulate JSON response
  • Combine two different data sources

Manipulate JSON response

You can write Query JSON with SQL for any query, mainly when you have a transformer, an API response or a JS query in Retool. You can write Query JSON with SQL to manipulate your data.

In the following example, I have a transformer filtering the records using SQL where condition. 

Retool SQL to JSON resource query

Combine two different data sources

You can also do that if you have two datasets and want to join both data sets based on any SQL join. For example, in the below image, you can see that I’m joining two transformers based on a key. 

Retool SQL to JSON resource query

If you have two JSON properties with the same name, use SQL alias. Otherwise, Retool will pick up the first occurrence.

Scroll to Top