ToolJet/docs/versioned_docs/version-3.5.0-LTS/getting-started/quickstart-guide.md
2025-11-24 10:32:41 +05:30

158 lines
7.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: quickstart-guide
title: Quickstart Guide
---
This quickstart guide walks you through the process of creating an employee directory app using ToolJet. The application lets users track and update employee details while working with core features of the platform, all within a user-friendly interface. Here are the step-by-step instructions:
**[1. Create Your First Application](#1-create-your-first-application)** <br/>
**[2. Create a Database Table](#2-create-a-database-table)** <br/>
**[3. Create a Query to Fetch Data](#3-create-a-query-to-fetch-data)** <br/>
**[4. Bind Queried Data to the UI](#4-bind-queried-data-to-the-ui)** <br/>
**[5. Create a Query to Add Data](#5-create-a-query-to-add-data)** <br/>
**[6. Use Events to Trigger Queries](#6-use-events-to-trigger-queries)** <br/>
**[7. Preview, Release and Share](#7-preview-release-and-share)** <br/>
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
### 1. Create Your First Application
To begin, create a free **[ToolJet](https://www.tooljet.com/signup)** account and follow the steps below.
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/3opM-aL_ct4?si=ubFBF7SpneufFb0s&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
- Click on the **Create new app** button on the dashboard. Name your application as "Employee Directory".
- Click and drag a **[Table](/docs/widgets/table)** component on the canvas. Optionally, you can also design a header by adding more components.
</div>
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
### 2. Create a Database Table
Now, create a new table in **[ToolJets Database](/docs/tooljet-db/tooljet-database/)** to store employee records.
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/a7qWJajVQ2o?si=KtppkSMB7JK4ANd1&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
- Name the table _employees_, then add the following columns: first_name, last_name, email, phone, department, position, joining, and status.
- Add a few employee records in the database table as placeholder data.
</div>
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
### 3. Create a Query to Fetch Data
To display employees in the application, you will first have to fetch the data from the database using a query.
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/IGuka14FHbs?si=3CNbMwP4w-D9t9kW&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
- Click on the **Add** button in the **[Query Panel](/docs/app-builder/query-panel/)** to create a new query.
- Select **ToolJet Database** as the data source for the query.
- Rename the query to _getEmployees_.
- Choose _employees_ as the Table name, and _List rows_ as the Operation.
- Click on the **Run** button to fetch data.
- To automatically run the query when the app starts, enable the toggle for _Run this query on application load_ from the query setting.
</div>
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
### 4. Bind Queried Data to the UI
Now, you need to bind the data returned by the _getEmployees_ query with the Table created in the first step.
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/fmLeeheFHsM?si=YzO-V_NHTyKHYkC5&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
- Click on the Table component to open its properties panel.
- Under the Data property, enter the below code:
```js
{
{
queries.getEmployees.data;
}
}
```
Now the Table component is filled with the data returned by the _getEmployees_ query.
</div>
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
### 5. Create a Query to Add Data
In the bottom-right corner of the Table component, there is a **+(Add new row)** button that opens an auto-generated form to add new data to the Table. Follow the steps below to create an _addEmployees_ query and execute it when you click the **Save** button on the auto-generated form.
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/mbvygFJYY9c?si=sEpqNlR36P8wlHBN&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
- Click on the **Add** button in the query panel, and select **ToolJet Database** as the data source.
- Select _employees_ as the Table name, and Create row as the Operation.
- Rename the query to _addEmployees_.
- Click on **Add Column** to add the required columns.
- Enter the code below for **first_name** and **email** column keys:
```js
{{components.table1.newRows[0].first_name}}
{{components.table1.newRows[0].email}}
...
```
Frame all the remaining keys in the same format.
</div>
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
### 6. Use Events to Trigger Queries
The _addEmployees_ query should run when you click the **Save** button on the auto-generated form. The Table component should then reload and display the updated data whenever a new employee is added. Follow the steps below to set up this functionality using events.
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/UJ3FyUqhhjE?si=pPun7LM7Rbs0g35C&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
- Click on the Table component, and click on **New event handler** in the properties panel.
- Choose Add new rows as the Event, Run Query as the Action, and _addEmployees_ as the Query.
- In the _addEmployees_ query's configuration, under the settings tab, click on **New event handler** to add a new event.
- Select Query Success as the Event, Run Query as the Action, and _getEmployees_ as the Query.
Now, when you click the **+ (Add new row)** button on the Table component, enter the employee details, and click **Save**, the data will be added to the database and automatically reflected in the Table component on the UI.
</div>
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
### 7. Preview, Release, and Share
The preview, release and share buttons are at the top-right of the App-Builder.
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/yY8UAC4FK44?si=fTdYYvUI3TK_NIWq&rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
- Click on the **Preview** button on the top-right of app builder to review how your application is coming along during development.
- Once the development is done and you are ready to use the application, click on the **Release** button to deploy the app.
- Finally, share your application with your end users using the **Share** button.
Congratulations on completing the tutorial! You've successfully built an employee directory application and, in the process, learnt the fundamentals of ToolJet.
</div>