Query Data
This page shows you how to create queries on Appsmith. You should connect the datasource before creating queries.
Click the Explorer tab on the entity explorer to the screen’s left.
You can create queries in two ways:
- Expand the Datasources section. Select the name of your datasource. Click the + New Query button on the top right of the page.
- Click the + icon next to next to Queries/JS. Select the datasource name from the Create new list.
Rename the query to be able to identify it when binding data.
For SQL databases (PostgreSQL, MySQL, MS SQL, etc.), you can write SQL queries in the query editor. For NoSQL databases(MongoDB, DynamoDB, Redis, etc.) and API datasources (REST API, GraphQL, Airtable, etc.), you need to set the required parameters to query the datasource. For examples of SQL queries and a complete description of the connection parameters, see the Reference guide.
You can click the Run button or hit
Cmd+Enter
to test if the query runs successfully. Appsmith doesn't store any data returned from your datasources and acts only as a proxy layer to orchestrate the execution of queries.