Skip to main content

Query Data

This page shows you how to create queries on Appsmith. You should connect the datasource before creating queries.

  1. Click the Explorer tab on the entity explorer to the screen’s left.

  2. 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.
      Creating query from Datasource section
      Creating query from Datasource section
    • Click the + icon next to next to Queries/JS. Select the datasource name from the Create new list.
      Creating query from Query/JS section
      Creating query from Query/JS section
  3. Rename the query to be able to identify it when binding data.

  4. 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.

  5. 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.