[docs]: Remove Deprecated Versions

This commit is contained in:
rudrapratik30 2026-03-12 18:10:59 +05:30
parent 727b7ae951
commit 7a303663ae
9770 changed files with 0 additions and 2240519 deletions

View file

@ -1,5 +0,0 @@
{
"label": "Enterprise",
"position": 9,
"collapsed": true
}

View file

@ -1,73 +0,0 @@
---
id: audit_logs
title: Audit logs
---
# Audit logs
The audit log is the report of all the activities done in your ToolJet account. It will capture and display events automatically by recording who performed an activity, what when, and where the activity was performed, along with other information such as IP address.
<img class="screenshot-full" src="/img/enterprise/audit_logs/audit_logs.gif" alt="ToolJet - Enterprise - Audit logs" height="420"/>
### Filter audit logs
Audited events can be filtered using the below characteristics:
#### Select Users
Select a specific user from this dropdown to check all their activities.
#### Select Apps
The dropdown will list all the apps present in your account. Choose an app to filter the logs associated with that app.
#### Select Resources
| Resources | description |
| ----------- | ----------- |
| User | Filter all the User events like `USER_LOGIN`, `USER_SIGNUP`, `USER_INVITE`, AND `USER_INVITE_REDEEM`. |
| App | Filter all the App events like `APP_CREATE`, `APP_UPDATE`,`APP_VIEW`,`APP_DELETE`,`APP_IMPORT`,`APP_EXPORT`,`APP_CLONE`. |
| Data Query | Filters the events associated with Data Query like `DATA_QUERY_RUN`. |
| Group Permission | All the events associated with Group Permissions will be filtered. Group Permissions include `GROUP_CREATE`, `GROUP_UPDATE`, `GROUP_DELETE`. |
| App Group Permission | Within each group, you can set apps for read or edit privileges. These events get recorded as App Group Permissions. |
#### Select Actions
| Actions | description |
| ----------- | ----------- |
| USER_LOGIN | This event is recorded everytime a user logins. |
| USER_SIGNUP | This event is recorded everytime a new signup is made. |
| USER_INVITE | You can invite users to your account from `Manage Users` section and an event is audited everytime an invite is sent. |
| USER_INVITE_REDEEM | This event is recorded whenever an invite is redeemed. |
| APP_CREATE | This event is recorded when a user creates a new app. |
| APP_UPDATE | This event is recorded whenever actions like renaming the app, making the app public, editing shareable link, or deploying the app are made. |
| APP_VIEW | This event is logged when someone views the launched app. (public apps aren't accounted for) |
| APP_DELETE | This event is recorded whenever a user deletes an app from the dashboard. |
| APP_IMPORT | This event is recorded whenever a user imports an app. |
| APP_EXPORT | This event is recorded whenever an app is exported. |
| APP_CLONE | This event is recorded whenever a clone of the existing app is created. |
| DATA_QUERY_RUN | This event is logged whenever a data source is added, a query is created, or whenever a query is run either from the query editor or from the launched app. |
| GROUP_PERMISSION_CREATE | This event is recorded whenever a group is created. |
| GROUP_PERMISSION_UPDATE | This event is recorded whenever an app or user is added to or removed from a group, or the permissions for a group are updated. |
| GROUP_PERMISSION_DELETE | This event is recorded whenever a user group is deleted from an account. |
| APP_GROUP_PERMISSION_UPDATE | For every app added in to user group, you can set privileges like `View` or `Edit` and whenever these privileges are updated this event is recorded. By default, the permission of an app for a user group is set to `View`. |
:::info
It is mandatory to set a Data Range in `From` and `To` to filter audit logs.
:::
### Understanding information from logs
<img class="screenshot-full" src="/img/enterprise/audit_logs/reading_logs.png" alt="ToolJet - Enterprise - Reading logs" />
| Property | description |
| ----------- | ----------- |
| action_type | It is the type of action that was logged in this event. Refer [this](#select-actions) to know about actions. |
| created_at | Displays the date and time of a logged event. |
| id | Every event logged has a specific event id associated with it. |
| ip_address | Displays the IP address from where the event was logged. |
| metadata | Metadata includes two sub-properties - `tooljet_version` and `user_agent`. `tooljet_version` displays the version of ToolJet used for the logged event and `user_agent` contains information about the device and browser used for that event. |
| organization_id | Every organization in ToolJet has an id associated with it and is recorded when an event occurs. |
| resource_id | There are several [resources](#select-resources) and for each resource that is created, an id gets associated with it.|
| resource_name | Displays the name of the [resources](#select-resources) that were logged in the event. For example, if an app was created or deleted then it will display the name of the app. |
| resource_type | Displays the type of the [resources](#select-resources) that were logged in the event. |
| user_id | Every user account in ToolJet has an id associated with it and is recorded when an event occurs. |

View file

@ -1,29 +0,0 @@
---
id: white-label
title: White Label
---
# White Label
White Label feature will allow you to remove the ToolJet branding from the ToolJet platform and add your own custom logo and text.
This feature allows you to rebrand the following:
- **App logo** (Logo on login screen, dashboard, and app-editor)
<img className="screenshot-full" src="/img/enterprise/white-label/applogo.png" alt="ToolJet - Enterprise - White label" height="420"/>
<img className="screenshot-full" src="/img/enterprise/white-label/appeditor.png" alt="ToolJet - Enterprise - White label" height="420"/>
- **Favicon**
- **Page Title** (next to Favicon)
<img className="screenshot-full" src="/img/enterprise/white-label/favicon.png" alt="ToolJet - Enterprise - White label" height="420"/>
## Configuration
To enable white labelling, you'll need to set the below mentioned **environment variables** in the .env file:
- `WHITE_LABEL_LOGO`: URL of the logo. Preferred dimensions of the logo are: width 130px and height 26px
- `WHITE_LABEL_TEXT`: The text that you want to display as Page Title
- `WHITE_LABEL_FAVICON`: URL of the favicon. Preferred dimensions of the logo are: 16x16px or 32x32px

View file

@ -1,5 +0,0 @@
{
"label": "Actions Reference",
"position": 7,
"collapsed": true
}

View file

@ -1,17 +0,0 @@
---
id: close-modal
title: Close modal
---
Use this action to close the modal that is already shown.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Open webpage](/img/actions/closemodal/closemodal.png)
</div>

View file

@ -1,97 +0,0 @@
---
id: control-component
title: Control component
---
Control component action invokes the component specific actions. Component specific actions are the actions that are exclusive actions for a particular widget. Component specific actions can be triggered either through the event handlers or from the Run JavaScript code query.
:::info
Check out the **[live demo](https://youtu.be/JIhSH3YeM3E)** of Component specific actions demonstrated in one of our community call.
:::
## Available Component Specific Actions
| Widget | Component Specific Actions |
|--------|---------------------------|
| Button | Click, Set label, Disable, Visibility, Loading |
| Text | Set text, Set Visibility |
| Text Input | Set text, Clear, Set Focus, Set Blur, Disable, Visibility |
| Text Area | Set text, Clear |
| Modal | Show, Close |
| Table | Set page |
| Dropdown | Select option |
| Multiselect | Select option, Deselect option, Clear selection |
| Map | Set location |
| Checkbox | Set checked |
| Radio button | Select option |
| Tabs | Set tab |
| Color picker | Set color |
| File picker | Clear files |
:::info
Currently, Component specific actions are supported only by the above listed widgets. We are working on bringing component specific actions for the remaining widgets.
:::
## Using Component Specific Actions
### Set a value for text input widget using button's event handler
- Drag a **Text Input** and a **Button** widget onto the canvas.
- Go to the **Inspector** on the left sidebar to check the exposed variables available for the `textinput1` widget under the `components`. You'll see that the variable `value` is an empty string because the field value of the text input widget is empty right now.
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Control Component](/img/actions/controlcomponent/inspector.png)
</div>
- Now enter some value in the text input widget and you'll see that the `value` in inspector has been updated.
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Control Component](/img/actions/controlcomponent/updated.png)
</div>
- Now, click on the button's widget handler to open up its properties in the right sidebar and then add a event handler for **On Click** event to trigger **Control Component** action. Select `textinput1` in component dropdown, `Set text` as Action, and in `Text` field enter the text that you want to update in the field value.
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Control Component](/img/actions/controlcomponent/button.png)
</div>
- Now when you'll click on the button you'll see that the field value of the text input widget has been updated with value that you set.
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Control Component](/img/actions/controlcomponent/set.png)
</div>
### Clear value of text input widget using JavaScript query
- Let's clear the value that we set in the previous section, using Run JavaScript code. Create a new Run JavaScript Code query and call the component and the CSA that component provides.
**Syntax:**
```js
await components.textinput1.clear()
```
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Control Component](/img/actions/controlcomponent/jsoption.png)
</div>
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Control Component](/img/actions/controlcomponent/clear.png)
</div>
- Finally, hit the **save and run** query button to fire up the query, and you'll see that the field value of the text input widget has been cleared.

View file

@ -1,16 +0,0 @@
---
id: copy-to-clipboard
title: Copy to clipboard
---
Use this action to copy the text to the clipboard.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Open webpage](/img/actions/copytoclipboard/copytoclipboard.png)
</div>

View file

@ -1,41 +0,0 @@
---
id: generate-file
title: Generate file
---
# Generate file
This action allows you to construct files on the fly and let users download it.
Presently, the only file type supported is `CSV`.
## Options
| Option | Description |
|--------|-------------|
| Type | Type of file to be generated |
| File name | Name of the file to be generated |
| Data | Data that will be used to construct the file. Its format will depend on the file type, as specified in the following section |
### Data format for CSV
For `CSV` file type, the data field should be supplied with an array objects. ToolJet assumes that the keys of each of
these objects are the same and that they represent the column headers of the csv file.
Example:
```javascript
{{
[
{ name: 'John', email: 'john@tooljet.com' },
{ name: 'Sarah', email: 'sarah@tooljet.com' },
]
}}
```
Supplying the above snippet will generate a csv file which looks like this:
```csv
name,email
John,john@tooljet.com
Sarah,sarah@tooljet.com
```

View file

@ -1,18 +0,0 @@
---
id: go-to-app
title: Go to app
---
This action allows you to open any ToolJet application when an event occurs.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Open webpage](/img/actions/gotoapp/gotoapp.png)
</div>

View file

@ -1,16 +0,0 @@
---
id: logout
title: Logout
---
This action allows you to log out of the application (ToolJet).
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Logout](/img/actions/logout/logout.png)
</div>

View file

@ -1,16 +0,0 @@
---
id: open-webpage
title: Open webpage
---
You can use this action to open a webpage(on a new tab) for any event.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Open webpage](/img/actions/open-webpage/open.png)
</div>

View file

@ -1,16 +0,0 @@
---
id: run-query
title: Run Query
---
This action allows you to fire queries when an event occurs.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Run Query](/img/actions/run-query/run-query.png)
</div>

View file

@ -1,55 +0,0 @@
---
id: set-localstorage
title: Set localStorage
---
# Set localStorage
This action allows you to specify a `key` and its corresponding `value` to be stored in localStorage.
## Example: App that stores a name in localStorage and displays it on reload
1. Add an input field, button and a text as shown
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference -Set local storage sample app](/img/actions/localstorage/1.png)
</div>
2. Select the button and add a `Set localStorage` action with `key` set to `name` and value pointing at the value of the text field
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference -Set local storage sample app](/img/actions/localstorage/2.png)
</div>
3. Select the text label we've added and set its value to the name item from localStorage
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference -Set local storage sample app](/img/actions/localstorage/3.png)
</div>
4. Now save the application, this is important as we're about to reload the page.
5. Type in anything you wish on the input box and click on the button
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference -Set local storage sample app](/img/actions/localstorage/5.png)
</div>
6. Reload the page, you'll see that the value stored in local storage is persisted and it is displayed on screen!
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference -Set local storage sample app](/img/actions/localstorage/6.png)
</div>

View file

@ -1,16 +0,0 @@
---
id: set-table-page
title: Set Table Page
---
Use this action to change the page index in the table widget.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Open webpage](/img/actions/settablepage/settablepage.png)
</div>

View file

@ -1,16 +0,0 @@
---
id: set-variable
title: Set variable
---
This action allows you to create a variable and assign a `value` to it.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference -Set variable](/img/actions/setvar/setvar.png)
</div>

View file

@ -1,21 +0,0 @@
---
id: show-alert
title: Show alert
---
This action allows you to display an alert message.
You can set a custom **message** for the alert and choose a particular alert type.
There are 4 types of alert messages - **Info**, **Success**, **Warning**, and **Danger**.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Show Alert](/img/actions/show-alert/show-alert.png)
</div>

View file

@ -1,16 +0,0 @@
---
id: show-modal
title: Show modal
---
Use this action to show the modal for an event.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference - Open webpage](/img/actions/showmodal/showmodal.png)
</div>

View file

@ -1,16 +0,0 @@
---
id: unset-variable
title: Unset variable
---
This action allows you to remove the variable variable that was created using the set variable action.
:::info
You can also trigger actions from the **JavaScript code**. Check it out [here](/docs/how-to/run-actions-from-runjs).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Action reference -Set variable](/img/actions/unsetvar/unsetvar.png)
</div>

View file

@ -1,5 +0,0 @@
{
"label": "Contributing Guide",
"position": 11,
"collapsed": true
}

View file

@ -1,81 +0,0 @@
---
id: code-of-conduct
title: Contributor Code of Conduct
---
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at hello@tooljet.com . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View file

@ -1,66 +0,0 @@
---
id: l10n
title: Localization
---
Welcome to ToolJet Localization Guide. The goal of the Localization is to make ToolJet easy to use and close to all countries, languages, and general cultural groups. On this page, you will find instructions on how to contribute to ToolJet through Localization and make a more friendly ToolJet for all regions.
## Adding Translations
- For adding the translations of your language in ToolJet, you'll need to create a new **languagecode.json** file which will include all the translations for the keywords in your language, and then list the language in the **languages.json** file for the language to be listed in the dashboard of the ToolJet.
- Go to the **frontend** directory which is at the root of ToolJet, then go to the **assets** and inside assets, you'll find the **translations** directory. You have created a new json file with the **language code** as the file name. The language code should follow [ISO 639-1 Code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
```
\frontend
|--\assets
|--\--\translations
|--\--\--\languages.json
|--\--\--\en.json
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/l10n/files.png" alt="files" />
</div>
- Let's localize ToolJet in the **French** language. Create a new json file inside the translations directory and name it **fr.json**. `fr` is the language code for French.
- After creating the new file, open the **en.json** file and copy all the contents of the file to the newly created **fr.json**.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/l10n/en.png" alt="files" />
</div>
- Once copied, you can now start adding the translations for the keywords in the french language.
- After completing the translation, all you need to do is list the language in **languages.json** file. You'll need to add an object with three key-value pairs. **lang** - the name of the language that you added, **code** - the language code, and the **nativeLang** - name of language in the native.
```js
{
"languageList":
[
{ "lang": "English", "code": "en", "nativeLang": "English" },
{ "lang": "French", "code": "fr", "nativeLang": "Français" }
]
}
```
- Once you list the language in the `language.json` file, you'll be able to see it in the **dashboard**.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/l10n/list.png" alt="files" />
</div>
:::info
ToolJet will automatically detect your browser's default language and will switch to it. If your browser's default language translation is not available in ToolJet then it will set English as the default language.
:::
:::note
Feel free to reach us on [Slack](https://tooljet.com/slack) for any help related to Localization.
:::

View file

@ -1,5 +0,0 @@
{
"label": "Setup",
"position": 1,
"collapsed": true
}

View file

@ -1,23 +0,0 @@
---
id: architecture
title: Architecture
---
# Introduction
ToolJet has two main components: **ToolJet Server** and **ToolJet Client**.
### 1. ToolJet Server
ToolJet server is a Node.js API application. Server is responsible for authentication, authorization, persisting application definitions, running queries, storing data source credentials securely and more.
**Dependencies:**
- **PostgreSQL** - ToolJet server persists data to a postgres database.
- **Email service** (SMTP/Sendgrid/Mailgun/etc) - Required to send user invitations and password reset emails.
### 2. ToolJet Client
ToolJet client is a ReactJS application. Client is responsible for visually editing the applications, building & editing queries, rendering applications, executing events and their trigger, etc.
## Requirements
1. **Node version 14.x**

View file

@ -1,193 +0,0 @@
---
id: docker
title: Docker
---
# Docker
Docker compose is the easiest way to setup ToolJet server and client locally.
:::info
If you rather want to try out ToolJet locally with docker, you can follow the steps [here](https://docs.tooljet.com/docs/setup/try-tooljet).
:::
## Prerequisites
Make sure you have the latest version of `docker` and `docker-compose` installed.
[Official docker installation guide](https://docs.docker.com/desktop/)
[Official docker-compose installation guide](https://docs.docker.com/compose/install/)
We recommend:
```bash
docker --version
Docker version 19.03.12, build 48a66213fe
docker-compose --version
docker-compose version 1.26.2, build eefe0d31
```
## Setting up
:::warning
If you are setting up on a Windows machine, we advise you to setup Docker desktop with WSL2.
Please find more information [here](https://docs.docker.com/desktop/windows/wsl/).
:::
1. Clone the repository
```bash
git clone https://github.com/tooljet/tooljet.git
```
2. Create a `.env` file by copying `.env.example`. More information on the variables that can be set is given in the [environment variables reference](/docs/setup/env-vars)
```bash
cp .env.example .env
cp .env.example .env.test
```
3. Populate the keys in the `.env` and `.env.test` file
:::info
`SECRET_KEY_BASE` requires a 64 byte key. (If you have `openssl` installed, run `openssl rand -hex 64` to create a 64 byte secure random key)
`LOCKBOX_MASTER_KEY` requires a 32 byte key. (Run `openssl rand -hex 32` to create a 32 byte secure random key)
:::
:::warning
If you are setting up on a Windows machine. Please make sure that .env file line endings to be LF as it will be CRLF by default unless configured for Windows machine.
:::
Example:
```bash
cat .env
TOOLJET_HOST=http://localhost:8082
LOCKBOX_MASTER_KEY=13c9b8364ae71f714774c82498ba328813069e48d80029bb29f49d0ada5a8e40
SECRET_KEY_BASE=ea85064ed42ad02cfc022e66d8bccf452e3fa1142421cbd7a13592d91a2cbb866d6001060b73a98a65be57e65524357d445efae00a218461088a706decd62dcb
NODE_ENV=development
# DATABASE CONFIG
PG_HOST=postgres
PG_PORT=5432
PG_USER=postgres
PG_PASS=postgres
PG_DB=tooljet_development
ORM_LOGGING=all
```
```bash
cat .env.test
TOOLJET_HOST=http://localhost:8082
LOCKBOX_MASTER_KEY=13c9b8364ae71f714774c82498ba328813069e48d80029bb29f49d0ada5a8e40
SECRET_KEY_BASE=ea85064ed42ad02cfc022e66d8bccf452e3fa1142421cbd7a13592d91a2cbb866d6001060b73a98a65be57e65524357d445efae00a218461088a706decd62dcb
NODE_ENV=test
# DATABASE CONFIG
PG_HOST=postgres
PG_PORT=5432
PG_USER=postgres
PG_PASS=postgres
PG_DB=tooljet_test
ORM_LOGGING=error
```
4. Build docker images
```bash
docker-compose build
docker-compose run --rm plugins npm run build:plugins
```
5. Run ToolJet
```bash
docker-compose up
```
6. ToolJet server is built using NestJS and the data such as application definitions are persisted on a postgres database. You can run the below command to seed the database.
```bash
docker-compose exec server npm run db:seed
```
7. ToolJet should now be served locally at `http://localhost:8082`. You can login using the default user created.
```
email: dev@tooljet.io
password: password
```
8. To shut down the containers,
```bash
docker-compose stop
```
## Making changes to the codebase
If you make any changes to the codebase/pull the latest changes from upstream, the tooljet server container would hot reload the application without you doing anything.
Caveat:
1. If the changes include database migrations or new npm package additions in the package.json, you would need to restart the ToolJet server container by running `docker-compose restart server`.
2. If you need to add a new binary or system library to the container itself, you would need to add those dependencies in `docker/server.Dockerfile.dev` and then rebuild the ToolJet server image. You can do that by running `docker-compose build server`. Once that completes you can start everything normally with `docker-compose up`.
Example:
Let's say you need to install the `imagemagick` binary in your ToolJet server's container. You'd then need to make sure that `apt` installs `imagemagick` while building the image. The Dockerfile at `docker/server.Dockerfile.dev` for the server would then look something like this:
```
FROM node:14.17.0-buster
RUN apt update && apt install -y \
build-essential \
postgresql \
freetds-dev \
imagemagick
RUN mkdir -p /app
WORKDIR /app
COPY ./server/package.json ./server/package-lock.json ./
RUN npm install
ENV NODE_ENV=development
COPY ./server/ ./
COPY ./docker/ ./docker/
COPY ./.env ../.env
RUN ["chmod", "755", "entrypoint.sh"]
```
Once you've updated the Dockerfile, rebuild the image by running `docker-compose build server`. After building the new image, start the services by running `docker-compose up`.
## Running tests
Test config picks up config from `.env.test` file at the root of the project.
Run the following command to create and migrate data for test db
```bash
docker-compose run --rm -e NODE_ENV=test server npm run db:create
docker-compose run --rm -e NODE_ENV=test server npm run db:migrate
```
To run the unit tests
```bash
docker-compose run --rm server npm run --prefix server test
```
To run e2e tests
```bash
docker-compose run --rm server npm run --prefix server test:e2e
```
To run a specific unit test
```bash
docker-compose run --rm server npm --prefix server run test <path-to-file>
```
## Troubleshooting
Please open a new issue at https://github.com/ToolJet/ToolJet/issues or join our [Slack Community](https://tooljet.com/slack) if you encounter any issues when trying to run ToolJet locally.

View file

@ -1,127 +0,0 @@
---
id: macos
title: Mac OS
---
# Mac OS
Follow these steps to setup and run ToolJet on macOS for development purposes. Open terminal and run the commands below. We recommend reading our guide on [architecture](/docs/contributing-guide/setup/architecture) of ToolJet before proceeding.
## Setting up
1. Set up the environment
1.1 Install Homebrew
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```
1.2 Install Node.js ( version: v14.17.3 ) and npm (version: v7.20.0)
```bash
brew install nvm
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
nvm install 14.17.3
nvm use 14.17.3
npm install -g npm@7.20.0
```
1.3 Install Postgres
:::tip
ToolJet uses a postgres database as the persistent storage for storing data related to users and apps. We do not plan to support other databases such as MySQL.
:::
```bash
brew install postgresql
```
1.4 Clone the repository
```bash
git clone https://github.com/tooljet/tooljet.git
```
2. Set up environment variables
Create a `.env` file by copying `.env.example`. More information on the variables that can be set is given in the [environment variables reference](/docs/setup/env-vars)
```bash
cp .env.example .env
```
3. Populate the keys in the env file
:::info
`SECRET_KEY_BASE` requires a 64 byte key. (If you have `openssl` installed, run `openssl rand -hex 64` to create a 64 byte secure random key)
`LOCKBOX_MASTER_KEY` requires a 32 byte key. (Run `openssl rand -hex 32` to create a 32 byte secure random key)
:::
Example:
```bash
cat .env
TOOLJET_HOST=http://localhost:8082
LOCKBOX_MASTER_KEY=1d291a926ddfd221205a23adb4cc1db66cb9fcaf28d97c8c1950e3538e3b9281
SECRET_KEY_BASE=4229d5774cfe7f60e75d6b3bf3a1dbb054a696b6d21b6d5de7b73291899797a222265e12c0a8e8d844f83ebacdf9a67ec42584edf1c2b23e1e7813f8a3339041
NODE_ENV=development
# DATABASE CONFIG
PG_HOST=postgres
PG_PORT=5432
PG_USER=postgres
PG_PASS=postgres
PG_DB=tooljet_development
ORM_LOGGING=all
```
4. Install and build dependencies
```bash
npm install
npm install --prefix server
npm install --prefix frontend
npm run build:plugins
```
5. Set up database
```bash
npm run --prefix server db:create
npm run --prefix server db:reset
```
:::info
If at any point you need to reset the database, use this command `npm run --prefix server db:reset`
:::
6. Run plugins compilation in watch mode
```bash
cd ./plugins && npm start
```
7. Run the server
```bash
cd ./server && npm run start:dev
```
8. Run the client
```bash
cd ./frontend && npm start
```
The client will start on the port 8082, you can access the client by visiting: [http://localhost:8082](http://localhost:8082)
9. Create login credentials
Visiting [https://localhost:8082](https://localhost:8082) should redirect you to the login page, click on the signup link and enter your email. The emails sent by the server in development environment are captured and are opened in your default browser. Click the invitation link in the email preview to setup the account.
## Running tests
Test config requires the presence of `.env.test` file at the root of the project.
To run the unit tests
```bash
npm run --prefix server test
```
To run e2e tests
```bash
npm run --prefix server test:e2e
```
To run a specific unit test
```bash
npm run --prefix server test <path-to-file>
```

View file

@ -1,107 +0,0 @@
---
id: ubuntu
title: Ubuntu
---
# Ubuntu
Follow these steps to setup and run ToolJet on Ubuntu. Open terminal and run the commands below.
## Setting up
1. Set up the environment
1.1 Install Node.js
```bash
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
# Ensure you have the correct version of npm, or it will cause an error about fsevents.
npm i -g npm@7.20.0
```
1.2 Install Postgres
```bash
sudo apt install postgresql postgresql-contrib
sudo apt-get install libpq-dev
```
2. Set up environment variables
Create a `.env` file by copying `.env.example`. More information on the variables that can be set is given in the [environment variables reference](/docs/setup/env-vars)
```bash
cp .env.example .env
```
3. Populate the keys in the env file
:::info
`SECRET_KEY_BASE` requires a 64 byte key. (If you have `openssl` installed, run `openssl rand -hex 64` to create a 64 byte secure random key)
`LOCKBOX_MASTER_KEY` requires a 32 byte key. (Run `openssl rand -hex 32` to create a 32 byte secure random key)
:::
Example:
```bash
cat .env
TOOLJET_HOST=http://localhost:8082
LOCKBOX_MASTER_KEY=1d291a926ddfd221205a23adb4cc1db66cb9fcaf28d97c8c1950e3538e3b9281
SECRET_KEY_BASE=4229d5774cfe7f60e75d6b3bf3a1dbb054a696b6d21b6d5de7b73291899797a222265e12c0a8e8d844f83ebacdf9a67ec42584edf1c2b23e1e7813f8a3339041
```
4. Install and build dependencies
```bash
npm install
npm install --prefix server
npm install --prefix frontend
npm run build:plugins
```
5. Set up database
```bash
npm run --prefix server db:create
npm run --prefix server db:reset
```
:::info
If at any point you need to reset the database, use this command `npm run --prefix server db:reset`
:::
6. Run plugins compilation in watch mode
```bash
cd ./plugins && npm start
```
7. Run the server
```bash
cd ./server && npm run start:dev
```
8. Run the client
```bash
cd ./frontend && npm start
```
The client will start running on the port 8082, you can access the client by visiting: [http://localhost:8082](http://localhost:8082)
9. Create login credentials
Visiting https://localhost:8082 should redirect you to the login page, click on the signup link and enter your email. The emails sent by the server in development environment are captured and are opened in your default browser. Click the invitation link in the email preview to setup the account.
## Running tests
Test config requires the presence of `.env.test` file at the root of the project.
To run the unit tests
```bash
npm run --prefix server test
```
To run e2e tests
```bash
npm run --prefix server test:e2e
```
To run a specific unit test
```bash
npm run --prefix server test <path-to-file>
```

View file

@ -1,18 +0,0 @@
---
id: windows
title: Windows
---
To run ToolJet, please install it in an Ubuntu environment using **[Windows Subsystem for Linux 2](https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-2---check-requirements-for-running-wsl-2)**. You can obtain the Ubuntu environment from the **Microsoft Store** by visiting this [link](https://apps.microsoft.com/store/detail/ubuntu-22042-lts/9PN20MSR04DW).
After successfully installing the Ubuntu environment, you will have access to a terminal window similar to the one shown below:
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/contributing-guide/windows/wsl2.png" alt="Windows setup" />
</div>
:::warning
If you are setting up ToolJet on a Windows machine, ensure that the line endings in the **.env** file are changed to LF. By default, they may be set to CRLF, which is not compatible unless configured specifically for Windows machines.
:::
Once the environment is set up, you can proceed with the steps outlined in the Ubuntu documentation at **[Contributing Guide - Ubuntu Setup](/docs/contributing-guide/setup/ubuntu)**.

View file

@ -1,90 +0,0 @@
---
id: slackcoc
title: Slack Code of Conduct
---
# Slack Code of Conduct
This code of conduct governs ToolJet's Slack Community events and discussions.
---
## Introduction
- Diversity and inclusion make our community strong. We encourage participation from the most varied and diverse backgrounds possible and want to be very clear about where we stand.
- Our goal is to maintain a safe, helpful and friendly community for everyone, regardless of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other defining characteristic.
- This code and related procedures apply to unacceptable behavior occurring in all community venues, including behavior outside the scope of community activities — online and in-person— as well as in all one-on-one communications, and anywhere such behavior has the potential to adversely affect the safety and well-being of community members.
## Expected behavior
- Be welcoming.
- Be kind.
- Look out for each other.
## Unacceptable Behavior
- Conduct or speech which might be considered sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory or offensive in nature.
- Do not use unwelcome, suggestive, derogatory or inappropriate nicknames or terms.
- Do not show disrespect towards others. (Jokes, innuendo, dismissive attitudes.)
- Intimidation or harassment (online or in-person).
- Disrespect towards differences of opinion.
- Inappropriate attention or contact. Be aware of how your actions affect others. If it makes someone uncomfortable, stop.
- Not understanding the differences between constructive criticism and disparagement.
- Sustained disruptions.
- Violence, threats of violence or violent language.
## Where does the Code of Conduct apply?
This Code of Conduct applies to all spaces managed by ToolJet. This includes:
- Conferences (including social events and peripheral activities)
- Unconferences and sprints
- Meetups, including their discussion boards
- Workshops
- Presentation materials used in talks or sessions
- Slack
- GitHub
- Twitter hashtag and mentions
- Any forums created by the ToolJet which the community uses for communication.
The Code of Conduct does not exclusively apply to slack or events on an official agenda. For example, if after a scheduled social event you go to a bar with a group of fellow participants, and someone harasses you there, we would still treat that as a CoC violation. Similarly, harassment in Twitter direct messages related to ToolJet can still be covered under this Code of Conduct.
In addition, violations of this code outside our spaces may affect a persons ability to participate in them.
## Enforcement
- Understand that speech and actions have consequences, and unacceptable behavior will not be tolerated.
- If you are the subject of, or witness to any violations of this Code of Conduct, please contact us via email at hello@tooljet.com or dm @navaneeth on slack.
- If violations occur, organizers will take any action they deem appropriate for the infraction, up to and including expulsion.
:::info
Portions derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/), [The Rust Code of Conduct](https://www.rust-lang.org/conduct.html) and [The Ada Initiative](https://adainitiative.org) under a Creative Commons Attribution-ShareAlike license.
:::
---
## Etiquettes to follow
#### 1. Be nice to everyone
#### 2. Check off your resolved questions
If you have received a useful reply to your question, please drop a ✅ reaction or a reply for affirmation.
#### 3. Try not to repost question
If you have asked a question and have not got a response in 24hrs, please review your question for clarity and revise it. If you still feel you haven't received adequate response, feel free to ping @navaneeth.
#### 4. Post in public
Please don't direct message any individual member of ToolJet community without their explicit permission, independent of reason. Your question might be helpful for other community members.
#### 5. Don't spam tags
ToolJet's community of volunteer is very active and helpful, generally avoid tagging members unless it is urgent.
#### 6. Use threads for discussion
To keep the main channel area clear, we request to use threads to keep an ongoing conversation organized.

View file

@ -1,57 +0,0 @@
---
id: testing
title: Testing
---
Follow the steps below to setup and run the test specifications using Cypress. We recommend [setting up ToolJet locally](/docs/contributing-guide/setup/macos) before proceeding.
## Setting up
- Navigate to the `cypress-tests` directory and enter the following command:
```bash
npm install
```
## Running Tests
#### Headed mode
- To run cypress in **headed** mode, run the following command:
```bash
npm run cy:open
```
- In **headed** mode, the user will be able to choose the test specs from the test runner:
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/testing/headed.png" alt="Cypress headed mode" />
</div>
#### Headless mode
- To run cypress in **headless** mode, run the following command:
```bash
npm run cy:run
```
- For running specific spec in headless mode, run for specific spec
```bash
npm run cy:run --spec "cypress/e2e/dashboard/multi-workspace/manageSSO.cy.js
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/testing/headless.png" alt="Cypress headless mode" />
</div>
:::caution
If some test specs need the environment variables, the user can pass them similar to the following command:
```bash
npm run cy:open -- --env='{"pg_host":"localhost","pg_user":"postgres", "pg_password":"postgres"}'
```
or the user can add env-vars in the **cypress.config.js** file
:::
:::info
Check all the Cypress commands [here](https://docs.cypress.io/guides/guides/command-line#Commands)
:::

View file

@ -1,43 +0,0 @@
---
id: eslint
title: EsLint
---
# ESLint
ESLint as a code quality tool is a tool that checks your code for errors and helps you to fix them and enforces a coding style.
## Setup
1. Install the [ESLint extension](https://eslint.org/docs/latest/user-guide/integrations) for your code editor.
2. Set your editor's default formatter to `ESLint`.
:::tip
For VSCode users, you can set the formatter to `ESLint` in the [**settings.json**](https://code.visualstudio.com/docs/getstarted/settings#_settingsjson).
:::
3. Install the dependencies.
```bash
npm install
npm install --prefix server
npm install --prefix frontend
```
4. Run the linter.
```bash
npm run --prefix server lint
npm run --prefix frontend lint
```
5. Fix the ESlint errors and warnings.
```bash
npm run --prefix server format
npm run --prefix frontend format
```
## Requirements
1. **Node version 14.17.3**
2. **npm version 7.20.0**

View file

@ -1,5 +0,0 @@
{
"label": "Tutorials",
"position": 2,
"collapsed": true
}

View file

@ -1,27 +0,0 @@
---
id: creating-widget
title: Creating Widgets
---
# Creating Widgets
These are some of the most useful properties and functions passed to the widget
### properties
The `properties` object will contain the configurable properties of a widget, initially obtained from its definition on `widgetConfig.js`.
The values inside `properties` change whenever the developer makes changes to the inspector panel of ToolJet editor.
### exposedVariables
The `exposedVariables` object will contain the values of all exposed variables as configured in `widgetConfig.js`.
### setExposedVariable('exposedVariableName', newValue)
This function allows you to update the value of an exposed variable to `newValue`.
### validate(value)
This function validates the `value` passed based on the validation settings configured on the inspector panel for the widget.
It returns an array `[isValid, validationError]`, which represents respectively, whether the `value` passed is valid,
and the error message if there is one.

View file

@ -1,226 +0,0 @@
---
id: creating-a-plugin
title: Creating Plugins
---
# Creating plugins for ToolJet
## What are plugins
ToolJet is built with extensibility in mind. Plugins allows developers to extend the functionalities of ToolJet using JavaScript. Plugins can only be connectors at this moment. For example, the data source connectors such as PostgreSQL, MySQL, Twilio, Stripe, etc are built as plugins.
In this guide, we will walk you through building plugins for ToolJet with the help of `tooljet` cli.
`tooljet` cli is a commandline tool built for building plugins easily. We will build a simple plugin for BigQuery in this guide.
### What does a plugin look like?
All the plugins live under the `/plugins` directory. The structure of a plugin looks like this:
```
my-awesome-plugin/
package.json
lib/
icon.svg
index.ts
operations.json
manifest.json
```
- manifest.json should include information such as the name of plugin, description, etc.
- operations.json should include the metadata of all the operations supported by the plugin.
- index.ts is the main file. It defines a `QueryService` for the plugin. The `QueryService` handles running of queries, testing connections, caching connections, etc.
- icon.svg is the icon for the plugin.
- package.json is auto generated by the cli.
## Getting Started
1. Install [tooljet-cli](https://www.npmjs.com/package/@tooljet/cli):
```bash
$ npm i -g @tooljet/cli
```
2. Bootstrap a new plugin using cli
```bash
$ tooljet plugin create bigquery
```
```bash
creating plugin... done
Plugin: bigquery created successfully
└─ plugins
└─ packages
└─ bigquery
```
3. Add the npm package of BigQuery to the plugin dependencies
```bash
$ tooljet plugin install @google-cloud/bigquery --plugin bigquery
```
4. Now the directory for our new plugin should looks something like below:
```bash
plugins/
package.json
packages/
bigquery/
__tests__
bigquery.test.js
package.json
lib/
icon.svg
index.ts
operations.json
manifest.json
```
5. Add data source config paramets to manifest.json
Our BigQuery plugin needs private key of a GCP service account to connect to BigQuery. Let's add `private_key` as a property for the data source.
```json
{
"$schema": "https://json-schema.org/",
"$id": "https://tooljet.io/BigQuery.schema.json",
"title": "BigQuery datasource",
"description": "A schema defining BigQuery datasource",
"type": "api",
"source": {
"name": "BigQuery",
"kind": "bigquery",
"exposedVariables": {
"isLoading": false,
"data": {},
"rawData": {}
},
"options": {
"private_key": { "encrypted": true }
}
},
"defaults": {
"private_key": { "value": "" }
},
"properties": {
"private_key": {
"label": "Private key",
"key": "private_key",
"type": "textarea",
"description": "Enter JSON private key for service account"
}
},
"required": ["private_key"]
}
```
6. Import npm package BigQuery to index.ts
```javascript
const { BigQuery } = require('@google-cloud/bigquery');
```
6. Edit index.ts to include the logic for creating a connection.
```javascript
async getConnection(sourceOptions: any, _options?: object): Promise<any> {
const privateKey = JSON.parse(sourceOptions['private_key']);
const client = new BigQuery({
projectId: privateKey['project_id'],
credentials: {
client_email: privateKey['client_email'],
private_key: privateKey['private_key'],
},
});
return client;
}
```
7. Edit index.ts to include the logic for testing connection.
When a new data source is being added to a ToolJet application, the connection can be tested.
:::info
NOTE: Every data source might not have a way to test connection. If not applicable for your data source, you can disable the test connection feature by adding `"customTesting": true,` to the `manifest.json` of your plugin.
:::
8. Add manifest entry for operations
In this example, let's add two operations for our BigQuery plugin.
- *List databases* - Lists all the databases.
- *Query database* - Query a specific database.
We need to make the entries to `operations.json`. The `operations.json` should look like this now:
```json
{
"$schema": "https://json-schema.org/",
"$id": "https://tooljet.io/dataqueries/Bigquery.schema.json",
"title": "Dynamodb datasource",
"description": "Operations for BigQuery plugin",
"type": "object",
"defaults": {},
"properties": {
"operation": {
"label": "Operation",
"key": "operation",
"type": "dropdown-component-flip",
"description": "Single select dropdown for operation",
"list": [
{
"value": "list_datasets",
"name": "List Datasets"
},
{
"value": "query",
"name": "Query"
}
]
},
"query": {
"query": {
"label": "Query",
"key": "query",
"type": "codehinter",
"description": "",
"height": "150px"
}
}
}
}
```
8. Handle the logic for running queries in `index.ts`
`QueryService` receives the metadata of the data source including the credentials and configs for connecting and parameters for the query that was run. In our example, `sourceOptions` will have the `private_key` of BigQuery datasource associated with the query. `queryOptions` will have the configs and parameters for the specific query. For example, `queryOption.operation` will give the id of current operation.
```javascript
export default class BigQueryQueryService implements QueryService {
async run(sourceOptions: any, queryOptions: any, _dataSourceId: string): Promise<QueryResult> {
const operation = queryOptions.operation;
const client = await this.getConnection(sourceOptions);
let result = {};
try {
switch (operation) {
case 'list_datasets':
result = await client.getDatasets();
break;
}
} catch (error) {
throw new QueryError('Query could not be completed', error.message, {});
}
return {
status: 'ok',
data: result,
};
}
}
```
9. Since it is a smiliar step for adding the logic for handling `query` operation, skipping it.
10. Test files are generated by the cli when a plugin is created. You can use `jest` for writing the tests.
Tests for a specific plugin can be run using the command `tooljet plugin test --bigquery`
13. The plugin is now ready!

View file

@ -1,5 +0,0 @@
{
"label": "Datasource Reference",
"position": 5,
"collapsed": true
}

View file

@ -1,230 +0,0 @@
---
id: airtable
title: Airtable
---
# Airtable
ToolJet can connect to your Airtable account to read and write data. **Airtable API key** is required to create an Airtable data source on ToolJet. You can generate API key by visiting [Airtable account page](https://airtable.com/account).
<img className="screenshot-full" src="/img/datasource-reference/airtable/airtableds.gif" alt="irtable record"/>
:::info
Airtable API has a rate limit, and at the time of writing this documentation, the limit is five(5) requests per second per base. You can read more about rate limits here **[Airtable API]( https://airtable.com/api )**.
:::
:::tip
This guide assumes that you have already gone through [Adding a data source](/docs/tutorial/adding-a-datasource) tutorial.
:::
## Supported queries
- **[Listing records](#listing-records)**
- **[Retrieving a record](#retrieving-a-record)**
- **[Creating a record](#creating-a-record)**
- **[Updating a record](#updating-a-record)**
- **[Deleting a record](#deleting-a-record)**
### Listing records
This query lists all the records in a table. The results are paginated and each page can have up to 100 records.
#### Required parameters:
- **Base ID:** To find the Base ID, first visit **airtable.com/api**. Select from the list of bases the base whose ID you'd like to find out. Example Base ID: `appDT3UCPffPiSmFd`
- **Table name:** Enter the table name whose data you want to fetch.
#### Optional parameters:
- **Page size:** The number of records returned in each request. Must be less than or equal to 100. Default is 100.
- **offset:** If there are more records, the response will contain an offset. To fetch the next page of records, include offset in the next request's parameters.
<img className="screenshot-full" src="/img/datasource-reference/airtable/airtable_list.png" alt="List airtable record" />
Example response from Airtable:
```json
{
"records": [
{
"id": "recu9xMnUdr2n2cw8",
"fields": {
"Notes": "sdfdsf",
"Name": "dsfdsf"
},
"createdTime": "2021-05-12T14:30:33.000Z"
},
{
"id": "recyIdR7bVdQvmKXa",
"fields": {
"Notes": "sdfdsf",
"Name": "dfds"
},
"createdTime": "2021-05-12T14:30:33.000Z"
},
{
"id": "recAOzdIHaRpvRaGE",
"fields": {
"Notes": "sdfsdfsd",
"Name": "sdfdsf"
},
"createdTime": "2021-05-12T14:30:33.000Z"
}
],
"offset": "recAOzdIHaRpvRaGE"
}
```
### Retrieving a record
#### Required parameters:
- **Base ID**
- **Table name**
- **Record ID**
<img className="screenshot-full" src="/img/datasource-reference/airtable/airtable_retrieve.png" alt="Retrieve airtable record" />
Example response from Airtable:
```json
{
"id": "recu9xMnUdr2n2cw8",
"fields": {
"Notes": "sdfdsf",
"Name": "dsfdsf"
},
"createdTime": "2021-05-12T14:30:33.000Z"
}
```
### Creating a record
#### Required parameters:
- **Base ID**
- **Table name**
- **Records**
<img className="screenshot-full" src="/img/datasource-reference/airtable/airtable_create.png" alt="Create airtable record" />
#### Example Records:
```json
[
{
"fields": {
"Notes": "sdfdsf",
"Name": "dsfdsf"
}
},
{
"fields": {
"Notes": "note1",
"Name": "dsfdsf"
}
}
]
```
Click on the `run` button to run the query.
:::info
NOTE: Query must be saved before running.
:::
Example response from Airtable:
```json
{
"records": [
{
"id": "rec5RuZ1COoZGtGDY",
"fields": {
"Notes": "sdfdsf",
"Name": "dsfdsf"
},
"createdTime": "2022-02-07T20:25:27.000Z"
},
{
"id": "recaYbFPonNNu6Cwj",
"fields": {
"Notes": "note1",
"Name": "dsfdsf"
},
"createdTime": "2022-02-07T20:25:27.000Z"
}
]
}
```
### Updating a record
#### Required parameters:
- **Base ID**
- **Table name**
- **Record ID**
<img className="screenshot-full" src="/img/datasource-reference/airtable/airtable_update.png" alt="Update airtable record"/>
#### Example body:
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/airtable/airtable-update-example-body.png" alt="Airtable update body" />
</div>
Click on the `run` button to run the query.
:::info
NOTE: Query must be saved before running.
:::
Example response from Airtable:
```json
{
"id": "recu9xMnUdr2n2cw8",
"fields": {
"Notes": "Example Notes",
"Name": "change"
},
"createdTime": "2021-08-08T17:27:17.000Z"
}
```
### Deleting a record
#### Required parameters:
- **Base ID**
- **Table name**
- **Record ID**
<img className="screenshot-full" src="/img/datasource-reference/airtable/airtable_delete.png" alt="Delete airtable record" />
Click on the `run` button to run the query.
:::info
NOTE: Query must be saved before running.
:::
Example response from Airtable:
```json
{
deleted: true
id: "recIKsyZgqI4zoqS7"
}
```

View file

@ -1,57 +0,0 @@
---
id: amazonses
title: Amazon SES
---
# Amazon SES
ToolJet can connect to your Amazon SES account to send emails.
## Connection
To add a new Amazon SES API datasource, click the **Datasource manager** icon on the left-sidebar of the app builder and click on the `Add datasource` button, then select Amazon SES from the modal that pops up.
ToolJet requires the following to connect to Amazon SES:
- **Region**
- **Access key**
- **Secret key**
It is recommended to create a new IAM user for the database so that you can control the access levels of ToolJet.
Click on the 'Save' button to save the data source.
## Supported operations
1. Email service
### Email service
Required parameters:
- Send email to
- Send email from
- Subject
- Body as text
Optional parameters:
- Body as HTML
- CC Addresses
- BCC Addresses
:::info
**Send mail to** - accepts an array/list of emails separated by comma.
For example:
`{{["dev@tooljet.io", "admin@tooljet.io"]}}`.
**Send mail from** - accepts a string.
For example: `admin@tooljet.io`
:::
:::tip
**Send a single email to multiple recipients** - The `Send mail to` field can contain an array of recipients, which will send a single email with all of the recipients in the field.
:::note
NOTE: Query should be saved before running.
:::

View file

@ -1,138 +0,0 @@
---
id: appwrite
title: Appwrite Database
---
# Appwrite Database
Now build applications on top of your Appwrite database.
## Connection
ToolJet connects to your Appwrite app using :
- **Host (API endpoint)**
- **Project ID**
- **Secret key**
You'll find the Secret key and other credentials on your Appwrite's project settings page. You may need to create a new key if you don't have one already.
:::info
You should also set the scope for access to a particular resource. Learn more about the **API keys and scopes** [here](https://appwrite.io/docs/keys).
:::
To connect Appwrite datasource to your ToolJet application, go to the data source manager on the left-sidebar and click on the `+` button. Select Appwrite from the list of available datasources, provide the credentials and click **Save**. It is recommended to check the connection by clicking on 'Test connection' button to verify if the service account can access Appwrite from the ToolJet server.
<img className="screenshot-full" src="/img/datasource-reference/appwrite/appwrite-init.gif" alt="Appwrite intro" />
## Querying Appwrite
After setting up the Appwrite datasource, you can click on the `+` button of the query manager at the bottom panel of the editor and select the Appwrite data source that you added in the previous step.
<img className="screenshot-full" src="/img/datasource-reference/appwrite/appwrite-query.gif" alt="Appwrite query" />
After selecting Appwrite datasource, select the operation that you want to perform on the Appwrite database and click **Save** to save the query.
:::tip
Query results can be transformed using Transformations. Read our **Transformation documentation** [here](/docs/tutorial/transformations)
:::
## Supported operations
1. **[List documents](#list-documents)**
2. **[Get document](#get-document)**
3. **[Create document](#add-document-to-collection)**
4. **[Update document](#update-document)**
5. **[Delete document](#delete-document)**
6. **[Bulk update using document id](#bulk-update-using-document-id)**
### List documents
This operation can be used to get a list of all the user documents.
#### Required parameters:
- **Collection ID:** You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection) or appwrite console. The value for collection ID field should be of `String` type.
#### Optional parameters:
- **Limit:** Maximum number of documents to return in the response. By default, it will return a maximum of 25 results. A maximum of 100 results is allowed per request. The Limit value should be of `integer` type.
- **Order fields:** Array of attributes used to sort results. The order field value should be an `array`.
- **Order types:** Array of order directions for sorting attributes. Possible values are DESC for descending order or ASC for ascending order. The order field value should be an `array`.
- **Field, Operator, and Value:** For filtering the results, you can enter a field(attribute) name, use the appropriate operator from the dropdown, and set a value.
<img className="screenshot-full" src="/img/datasource-reference/appwrite/appwrite_list.png" alt="Appwrite List" />
### Get document
Use this operation to get a document from a collection by its unique ID.
#### Required parameters:
- **Collection ID:** You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection) or appwrite console. The value for collection ID should be of `String` type.
- **Document ID:** Enter the document ID of the document that you want to get. The document ID should be of `String` type.
<img className="screenshot-full" src="/img/datasource-reference/appwrite/appwrite_get.png" alt="Appwrite get" />
### Add Document to Collection
Use this operation to create a new document in a collection.
#### Required parameters:
- **Collection ID:** You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection) or appwrite console. The collection ID should be of `String` type.
- **Body:** Enter the document data as a JSON object.
<img className="screenshot-full" src="/img/datasource-reference/appwrite/appwrite_add.png" alt="Appwrite add" />
### Update document
Use this operation to update a document.
#### Required parameters:
- **Collection ID:** You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection) or appwrite console. The value for collection ID should be of `String` type.
- **Document ID:** Enter the document ID of the document that you want to get. The document ID should be of `String` type.
- **Body:** Enter the document data as a JSON object.
<img className="screenshot-full" src="/img/datasource-reference/appwrite/appwrite_update.png" alt="Appwrite update" />
### Delete document
Use this operation for deleting a document in the collection.
#### Required parameters:
- **Collection ID:** You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection) or appwrite console. The value for collection ID should be of `String` type.
- **Document ID:** Enter the document ID of the document that you want to get. The document ID should be of `String` type.
<img className="screenshot-full" src="/img/datasource-reference/appwrite/appwrite_delete.png" alt="Appwrite delete"/>
### Bulk update using document id
Use this operation for bulk updating a document in a collection.
#### Required parameters:
- **Collection ID:** You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection) or appwrite console. The value for collection ID should be of `String` type.
- **Key for document ID:** Enter the key or attribute name that can be used to identify each record.
- **Records:** The array of objects that will contain the data for updating each record in the database
and these objects must contain a key-value pair to point unique record in the database (key for document)
<img className="screenshot-full" src="/img/datasource-reference/appwrite/appwrite_bulk.png" alt="Appwrite bulk update" />

View file

@ -1,71 +0,0 @@
# Athena
ToolJet can connect to Amazon Athena which is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL.
- [Connection](#connection)
- [Querying-athena](#querying-amazon-athena)
- [Basic Operation](#basic-queries)
## Connection
ToolJet requires the following to connect to your Athena.
- **Database**
- **S3 output location**
- **Access key**
- **Secret key**
- **Region**
:::info
You can also configure for **[additional optional parameters](https://github.com/ghdna/athena-express)**.
:::
<img className="screenshot-full" src="/img/datasource-reference/athena/athena-connection.png" alt="Athena connection" />
## Querying Amazon Athena
- Click on `+` button of the query manager at the bottom panel of the editor and select the database added in the previous step as the datasource. Query manager then can be used to write SQL queries.
<img className="screenshot-full" src="/img/datasource-reference/athena/athena-query.png" alt="Athena query" />
- Click on the `run` button to run the query.
**NOTE:** Query should be saved before running.
:::tip
Refer amazon athena docs here for more info: [link](https://docs.aws.amazon.com/athena/latest/ug/what-is.html)
:::
### Basic queries
:::tip
**Refer amazon athena docs here for more info:** [link](https://docs.aws.amazon.com/athena/latest/ug/what-is.html)
:::
#### Creating table
```sql
CREATE EXTERNAL TABLE student (
name STRING,
age INT
) LOCATION 's3://athena-express-akiatfa53s-2022/';
```
#### Inserting to table
```sql
INSERT INTO student
VALUES ('Lansing',1)
```
#### Select operation
```sql
SELECT * from student WHERE AGE=1
```

View file

@ -1,269 +0,0 @@
---
id: baserow
title: Baserow
---
# Baserow
## Connection
ToolJet can connect to your Baserow account to read and write data.
Select the hosted version of Baserow or the self-host option.
For [**self-hosted**](https://baserow.io/docs/index#installation) option, base URL is required to connect.
Baserow API token is required to create an Baserow data source on ToolJet. You can follow the steps to create API token from [this link](https://baserow.io/api-docs).
<img className="screenshot-full" src="/img/datasource-reference/baserow/baserow-intro.png" alt="Baserow intro" />
:::tip
This guide assumes that you have already gone through [Adding a data source](/docs/tutorial/adding-a-datasource) tutorial.
:::
## Supported queries
- [List fields](#list-fields)
- [List rows](#list-rows)
- [Get row](#get-row)
- [Create row](#create-row)
- [Update row](#update-row)
- [Move row](#move-row)
- [Delete row](#delete-row)
### List fields
This query lists all the fields in a table.
#### Required parameters:
- **Table ID**
<img className="screenshot-full" src="/img/datasource-reference/baserow/baserow-list-fields.png" alt="Baserow list fields" />
Example response from Baserow:
```json
[
{
"id": 331156,
"table_id": 57209,
"name": "Name",
"order": 0,
"type": "text",
"primary": true,
"text_default": ""
},
{
"id": 331157,
"table_id": 57209,
"name": "Last name",
"order": 1,
"type": "text",
"primary": false,
"text_default": ""
},
{
"id": 331158,
"table_id": 57209,
"name": "Notes",
"order": 2,
"type": "long_text",
"primary": false
},
{
"id": 331159,
"table_id": 57209,
"name": "Active",
"order": 3,
"type": "boolean",
"primary": false
}
]
```
### List rows
This query lists all the rows in a table.
#### Required parameters:
- **Table ID**
<img className="screenshot-full" src="/img/datasource-reference/baserow/baserow-list-rows.png" alt="Baserow list"/>
Example response from Baserow:
```json
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"order": "0.99999999999999999991",
"Name": "Bill",
"Last name": "Gates",
"Notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dignissim, urna eget rutrum sollicitudin, sapien diam interdum nisi, quis malesuada nibh eros a est.",
"Active": false
},
{
"id": 3,
"order": "0.99999999999999999992",
"Name": "Mark",
"Last name": "Zuckerburg",
"Notes": null,
"Active": true
},
{
"id": 1,
"order": "0.99999999999999999997",
"Name": "Elon",
"Last name": "Musk",
"Notes": null,
"Active": true
}
]
}
```
### Get row
#### Required parameters:
- **Table ID**
- **Row ID**
<img className="screenshot-full" src="/img/datasource-reference/baserow/baserow-get-row.png" alt="Baserow get" />
Example response from Baserow:
```json
{
"id": 1,
"order": "0.99999999999999999997",
"Name": "Elon",
"Last name": "Musk",
"Notes": null,
"Active": true
}
```
### Create row
#### Required parameters:
- **Table ID**
- **Records**
<img className="screenshot-full" src="/img/datasource-reference/baserow/baserow-create-row.png" alt="Bserow create"/>
#### Example Records:
```json
{
"Name": "Test",
"Last name": "Test Name",
"Notes": "Test Note",
"Active": true
}
```
Example response from Baserow:
```json
{
"id": 19,
"order": "0.99999999999999999996",
"Name": "Test",
"Last name": "Test Name",
"Notes": "Test Note",
"Active": true
}
```
### Update row
#### Required parameters:
- **Table ID**
- **Row ID**
- **Records**
<img className="screenshot-full" src="/img/datasource-reference/baserow/baserow-update-row.png" alt="Baserow update" />
#### Example Records:
```json
{
"Name": "Test",
"Last name": "Test Name",
"Notes": "Test Note",
"Active": true
}
```
Example response from Baserow:
```json
{
"id": 19,
"order": "0.99999999999999999996",
"Name": "Test",
"Last name": "Test Name",
"Notes": "Test Note",
"Active": true
}
```
### Move row
#### Required parameters:
- **Table ID**
- **Row ID**
#### Optional parameters:
- **Before ID** (The row will be moved before the entered ID. If not provided, then the row will be moved to the end )
<img className="screenshot-full" src="/img/datasource-reference/baserow/baserow-move-row.png" alt="Baserow move row" />
Example response from Baserow:
```json
{
"id": 3,
"order": "2.00000000000000000000",
"Name": "Mark",
"Last name": "Zuckerburg",
"Notes": null,
"Active": true
}
```
### Delete row
#### Required parameters:
- **Table ID**
- **Row ID**
<img className="screenshot-full" src="/img/datasource-reference/baserow/baserow-delete-row.png" alt="Baserow delete" />
While deleting a row, the response will be either success or failure from Baserow

View file

@ -1,160 +0,0 @@
---
id: bigquery
title: BigQuery
---
# BigQuery
ToolJet can connect to BigQuery databases to run BigQuery queries.
## Connection
Please refer [this](https://cloud.google.com/bigquery/docs/bigquery-web-ui) link to enable BigQuery API in Google Cloud Console.
Create **Service Account** and **key**, then get your configs downloaded as **JSON**
To add a new BigQuery, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select BigQuery from the modal that pops up.
ToolJet requires the config json downloaded from your account to connect to BigQuery. Paste the json into the `Private key` field.
**The json looks like**:
```json
{
"type": "service_account",
"project_id": "tooljet-279812",
"private_key_id": "ea6e234sdfsdf3242b91525626edeef74a14e58761",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADAAhdh67sidfnIUWWWBAQC8V+z0vaM/rFiA\nrq8fzVjSpEu7Cietjn82SVtguAlAUP9YpRepzi4rDmRgVQiXe4KES7VGQhmg3hUj\nbBASbdI5WRCvAC2ujzrxv3rbfjYRWfm+OqzpUBWaEKbwSGc6rNkhmirvhjiFdl5k\nn7aK7w3bmQfBlnNM6+WiQdT09g2qx3lmRDoUUpuCngkhbWOs3gN/U6wlm0cHKtbF\nWUOwKdyeZrm3UORUDkFvq6rVSF8vob+FQxf24FuvpBmXi2o2dqqglle8rlm8Lz83\ns4kAVbqVjtGrVXm6QUcnLISqJCJUnFkSuFpo60GCcgAVrwyAq/6aQH3IM78QKzFL\n8q5b65rXAgMBAAECggEAClIF8tRk0VuG3NZH5lg3q8fDOyaLBFdVKcHKtzCec3Ez\no6C4RcxP6Hk5IbPrtgggjVIi/Z7exKRv2mAwFvuSuJJSQSSjXC7Fm87AQPdYFWYt\noFYIeLGPlFMO++H3Nh+Xt3I5NBLR58UmH48iBdgR3pygXi1C5eBvQ2rdNVTL/uxw\n3iULu8WcVBw8glzkdLNLDq94uqbW7/qyji7QWNkU+804sA0LEj4PWmO7B9k1LCLK\nFV0Ppv+SJYMS2MhWmXPHnYVfeNaKJKPQpHsS2ep/hyjEO/3Fvm3o3cp6SrEkNGIH\nGKeozlfV7MQj7tMHLqWddDBXtFwYVEmN0UJVafvGsQKBgQDsEVzb7DG/xlMpuDQv\nqpLGWXR5DdAhzxVJzeh11Ongb+XxBOVSyTDKJLvOX4rI7tDqqN7b2pabUA3ZjvXv\nhMPXr7AjL6yoJEzVCyo1+pi26OL99OcO+7gUDa0axHFt6LZuPw00r+2Nl0FqrXNR\n+qUiPuZpp2MuKjMwLCwhr5YuqwKBgQDMPv6TPMl+oocoQ4uc84uY58Ywb7XZjmhY\n8jXdA38I454EbQGeLja+2knDpDkF6g14cTzVJe/Ec4A6QmeIieTFSJKBV4VCZ3QN\npLR4PrET7o9GL3mtwnNqcHPw2dLNHtn1OgsOUfJMWPIrFK2abVNAmYIBtOGA4eyH\nrOl+NcAUhQKBgC4EKGy6OuxeFYHxZULRZjEB6QFb3vFoM4cieyjU6w4T4ee8g5NC\nop8U0AMnfp8yZkkHyAFlN6xoy3pYMrqQz7gwiA4j0e0ovk1dEspY4gHtnanRXmT+\nTmCiVdb86ft5vG37HnDhxlWuYVMRIoSdbikhx7papauvEDFYuvWKC6VnAoGBAJQr\nvxOhrauozNRw6//YzxUGT8kjwZEqtpiQXnMP7kDMn/4l9l6CuESMp6a+pH+d5FfU\nDoWzF9Y01HlvYxyyrLxSgbZDf/FEi/S54BK7qEsFbftExclAn+o/2lyIKV2VXBmD\nGjIxUM4CWOzX+3lkhlj/BEmop0+Qlr92uY1OASLhAoGAfTb/Le0Nf5bGLjK3hI9D\no/oDI5Ryj5rTMxmG/wRjE+1Jm6BjFzEyH2CvnFonccyHQ+wGn61AgbRFLn+Tg5fz\nZXpzD2Xq3Y/AXtrdaayK0wnpMvVE1bZt+ikeVAWX+gR79igTqSXRgCuyp+edsgcE\nZ+2Eser4Z5BpqfFjqFW8MhY=\n-----END PRIVATE KEY-----\n",
"client_email": "tooljettest@tooljet-279812.iam.gserviceaccount.com",
"client_id": "106795637455432158803",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/tooljettest%40tooljet-279812.iam.gserviceaccount.com"
}
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/bigquery/bq-create.png" alt="BQ create" />
</div>
Click on **Test connection** button to verify if the credentials are correct and that the API is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying BigQuery
Click on `+` button of the query manager at the bottom panel of the editor and select the database added in the previous step as the data source. Select the operation that you want to perform and click **Save** to create the query.
<img className="screenshot-full" src="/img/datasource-reference/bigquery/bq-query.png" alt="BQ query" />
Click on the **run** button to run the query. NOTE: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::
## Supported operations
- [List Datasets](#list-datasets)
- [List Tables](#list-tables)
- [Query](#query)
- [Insert Record ](#insert-record)
- [Delete Record ](#delete-record)
- [Update Record](#update-record)
- [Create View](#create-view)
- [Create Table](#create-table)
- [Delete Table](#create-table)
### List Datasets
Returns list of datasets.
#### Optional parameters:
- **Options:** This can be used to filter the list.
<img className="screenshot-full" src="/img/datasource-reference/bigquery/list_datasets.png" alt="BQ list datasets"/>
### List Tables
Return list of tables within a dataset
#### Required parameters:
- **Dataset:** Enter the dataset name.
<img className="screenshot-full" src="/img/datasource-reference/bigquery/listtables.png" alt="BQ list tables"/>
### Query
Return data based on the `Query`. `Query options` ([Reference](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job)), and `Query result options` ([Reference](https://cloud.google.com/nodejs/docs/reference/bigquery/latest/overview#_google_cloud_bigquery_QueryResultsOptions_type)).
<img className="screenshot-full" src="/img/datasource-reference/bigquery/query.png" alt="BQ query"/>
### Insert Record
- To insert a record.
<img className="screenshot-full" src="/img/datasource-reference/bigquery/bq-insert.png" alt="BQ insert" />
### Delete Record
- To delete a record.
<img className="screenshot-full" src="/img/datasource-reference/bigquery/bq-delete.png" alt="BQ delete" />
:::info
NOTE: Be careful when deleting records in a table. If you omit the WHERE clause, all records in the table will be deleted!
:::
### Update Record
- To update a record.
<img className="screenshot-full" src="/img/datasource-reference/bigquery/bq-update.png" alt="BQ update" />
:::info
NOTE: Be careful when deleting records in a table. If you omit the WHERE clause, all records in the table will be updated!
:::
### Create View
- To create a view.
<img className="screenshot-full" src="/img/datasource-reference/bigquery/bq-view.png" alt="BQ create view" />
### Create Table
- To create a table.
:::info
NOTE: visit -https://github.com/googleapis/nodejs-bigquery/blob/main/samples/createTable.js for more info on schema.
:::
### Delete Table
- To delete a table.

View file

@ -1,211 +0,0 @@
---
id: clickhouse
title: ClickHouse
---
# ClickHouse
ToolJet can connect to the ClickHouse to read and write data.
:::info
ToolJet uses this [NodeJS](https://github.com/TimonKK/clickhouse) client for ClickHouse.
:::
## Connection
To add a new ClickHouse datasource, Go to the **Datasource Manager** on the left sidebar of the app editor and click on `Add datasource` button. Select **ClickHouse** from the modal that pops up.
ToolJet requires the following to connect to your ClickHouse Database:
- **Username**
- **Password**
- **Host**
- **Port**
- **Database Name**
- **Protocol**
- **Use Post**
- **Trim Query**
- **Use Gzip**
- **Debug**
- **Raw**
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/connection.png" alt="ClickHouse connection" />
## Querying ClickHouse
After setting up the ClickHouse datasource, you can click on the `+` button of the query manager and select the ClickHouse datasource that you added in the previous step to create a new query.
:::info
For more details on clickhouse visit [Clickhouse docs](https://clickhouse.com/docs/en/quick-start).
:::
## Supported Operations:
- [SQL Query](#sql-query)
- [Insert array of objects](#supported-operations)
### SQL Query
Use this to operation to enter **[ClickHouse SQL Statements](https://clickhouse.com/docs/en/sql-reference/statements/)**. These statements represent various kinds of action you can perform using SQL queries.
#### Example SQL queries
- **SELECT**:
```sql
SELECT * from test array;
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/select.png" alt="ClickHouse SQL Statement operation" />
</div>
- **CREATE**:
```sql
CREATE TABLE test array3 (
date Date,
str String,
arr Array(String),
arr2 Array (Date)
arr3 Array(UInt32) ,
id1 UUID
)ENGINE=MergeTree () ORDER BY(str)
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/create.png" alt="ClickHouse SQL Statement operation" />
</div>
- **ALTER TABLE**(add column)
```sql
ALTER TABLE test array1 ADD COLUMN Added2 UInt32;
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/alter.png" alt="ClickHouse SQL Statement operation" />
</div>
- **SELECT WITH WHERE CLAUSE**
```sql
SELECT * FROM test array1 WHERE str='Somethingl...'
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/selectwithwhere.png" alt="ClickHouse SQL Statement operation" />
</div>
- **UPDATE**
```sql
ALTER TABLE test_array1 UPDATE arr = (12] WHERE str='Somethingl...'
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/update.png" alt="ClickHouse SQL Statement operation" />
</div>
- **DELETE**
```sql
ALTER TABLE test_array1 DELETE WHERE str= 'Somethingl...'
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/delete.png" alt="ClickHouse SQL Statement operation" />
</div>
- **NORMAL INSERT**
1) Step 1 - Creating Table
```sql
CREATE TABLE test array4 (
name String,
date Date
)ENGINE=MergeTree () ORDER BY (name)
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/step1.png" alt="ClickHouse SQL Statement operation" />
</div>
2) Step 2 - Insert
```sql
INSERT INTO test_array4 (*) VALUES ('juvane', '1996-01-13')
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/step1.png" alt="ClickHouse SQL Statement operation" />
</div>
:::info
**Giving Primary Key**
```
CREATE TABLE db.table_name
(
name1 type1, name2 type2, ...,
PRIMARY KEY(expr1[, expr2,...])]
)
ENGINE = engine;
OR
CREATE TABLE db.table_name
(
name1 type1, name2 type2, ...
)
ENGINE = engine
PRIMARY KEY(expr1[, expr2,...]);
```
:::
### Insert array of objects
Use this operation for inserting array of objects.
#### Required Parameters:
- **Body**
- **Fields**
- **Table name**
**Example Body value:**
```javascript
[
{
date: '2018-01-01',
str: 'Something1...',
arr: [],
arr2: ['1985-01-02', '1985-01-03'],
arr3: [1,2,3,4,5],
id1: '102a05cb-8aaf-4f11-a442-20c3558e4384'
},
{
date: '2018-02-01',
str: 'Something2...',
arr: ['5670000000', 'Something3...'],
arr2: ['1985-02-02'],
arr3: [],
id1: 'c2103985-9a1e-4f4a-b288-b292b5209de1'
}
];
```
<img className="screenshot-full" src="/img/datasource-reference/clickhouse/insertarray.png" alt="ClickHouse Insert array of objects operation" />

View file

@ -1,91 +0,0 @@
---
id: cosmosdb
title: CosmosDB
---
# Cosmosdb
ToolJet can connect to CosmosDB databases to read and write data.
## Connection
To add a new **[Azure Cosmos DB](https://docs.microsoft.com/en-us/javascript/api/overview/azure/cosmos-readme?view=azure-node-latest#key-concepts)**, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select CosmosDB from the modal that pops up.
ToolJet requires the following to connect to your Cosmos DB.
- **Cosmos DB Account End point**
- **Cosmos DB Account Key**
:::info
**Azure Cosmos DB End point** is the URL of the Cosmos DB service.
**Azure Cosmos DB Key** is the key that is used to access the Cosmos DB service.
You can find the endpoint and key in the **[Azure Portal](https://portal.azure.com/)**.
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - CosmosDB](/img/datasource-reference/cosmosdb/cosmosdb-connect.png)
</div>
## Supported queries:
- [Listing databases](#listing-databases)
- [Listing containers](#listing-containers)
- [Inserting item(s)](#inserting-items)
- [Retrieving an item](#retrieving-an-item)
- [Deleting an item](#deleting-an-item)
- [Querying documents](#querying-documents)
### Listing databases
This query lists all the databases in a Cosmos DB.
### Listing containers
This query lists all the containers of a database in a Cosmos DB.
| Fields | description |
| ----------- | ----------- |
| database | id of the database |
### Inserting item(s)
This query inserts one or more items in a container of a database in a Cosmos DB.
| Fields | description |
| ----------- | ----------- |
| database | id of the database |
| container | id of the container |
| items | items to be inserted. Example: `{{[{name: "one", val: 1}, {name:"two", val: 2}]}}` |
### Retrieving an item
To read a single item from a container of a database in a Cosmos DB, use the following query.
| Fields | description |
| ----------- | ----------- |
| database | id of the database |
| container | id of the container |
| item | id of the item |
### Deleting an item
To delete an item from a container of a database in a Cosmos DB, use the following query.
| Fields | description |
| ----------- | ----------- |
| database | id of the database |
| container | id of the container |
| item | id of the item |
### Querying documents
To query documents from a container of a database in a Cosmos DB using SQL-like syntax, use the following query.
| Fields | description |
| ----------- | ----------- |
| database | id of the database |
| container | id of the container |
| query | query to be executed. Example: `SELECT * FROM c WHERE c.age > 20 AND c.age <= 30` |

View file

@ -1,311 +0,0 @@
---
id: couchdb
title: CouchDB
---
# CouchDB
ToolJet can connect to CouchDB databases to read and write data. CocuhDB uses basic auth for authentication , username and password for the database is required to create an CouchDB data source on ToolJet. For more info visit [CouchDB docs](https://docs.couchdb.org/en/stable/).
<img className="screenshot-full" src="/img/datasource-reference/couchdb/auth_couch.gif" alt="Couch auth" />
## Supported queries:
- [Listing records](#listing-records)
- [Retrieving a record](#retrieving-a-record)
- [Creating a record](#creating-a-record)
- [Updating a record](#updating-a-record)
- [Deleting a record](#deleting-a-record)
- [Find](#find)
- [Retrieving a view](#retrieving-a-view)
:::info
NOTE: Record ID is same as document ID("_id") .
:::
### Listing records
This query lists all the records in a database.
#### Optional parameters:
- **Include docs**
- **Descending order**
- **Limit**
- **Skip**
:::info
descending (boolean) Return the documents in descending order by key. Default is false.
limit (number) Limit the number of the returned documents to the specified number.
skip (number) Skip this number of records before starting to return the results. Default is 0.
include_docs (boolean) include_docs key is set to false by default , if true it returns the document data along with the default fields.
:::
<img className="screenshot-full" src="/img/datasource-reference/couchdb/listing.png" alt="Couch listing"/>
Example response from CouchDb:
```json
{
"total_rows": 3,
"offset": 0,
"rows": [
{
"id": "23212104e60a71edb42ebc509f000dc2",
"key": "23212104e60a71edb42ebc509f000dc2",
"value": {
"rev": "1-0cc7f48876f15883394e5c139c628123"
}
},
{
"id": "23212104e60a71edb42ebc509f00216e",
"key": "23212104e60a71edb42ebc509f00216e",
"value": {
"rev": "1-b3c45696b10cb08221a335ff7cbd8b7a"
}
},
{
"id": "23212104e60a71edb42ebc509f00282a",
"key": "23212104e60a71edb42ebc509f00282a",
"value": {
"rev": "1-da5732beb913ecbded309321cac892d2"
}
},
]
}
```
### Retrieving a record
#### Required parameters:
- **Record ID**
<img className="screenshot-full" src="/img/datasource-reference/couchdb/retrieving.png" alt="Couch retrieve view" />
Example response from CouchDb:
```json
{
"_id": "e33dc4e209689cb0400d095fc401a1e0",
"_rev": "1-a62af8e14451af88c150e7e718b7a0e8",
"0": {
"name": "test data"
}
}
```
The returned JSON is the JSON of the document, including the document ID and revision number:
### Creating a record
<img className="screenshot-full" src="/img/datasource-reference/couchdb/creating.png" alt="Couch create view"/>
#### Example Records:
```json
[{"name":"tooljet"}]
```
Click on the `run` button to run the query.
:::info
NOTE: Query must be saved before running.
:::
Example response from CouchDb:
```json
{
"ok": true,
"id": "23212104e60a71edb42ebc509f0049a2",
"rev": "1-b0a625abc4e21ee554737920156e911f"
}
```
### Updating a record
You can get the revision id value, by sending a GET request to get the document details.
You get the document as JSON in the response. For each update to the document, the revision field "_rev" gets changed.
#### Required parameters:
- **Revision ID**
- **Record ID**
<img className="screenshot-full" src="/img/datasource-reference/couchdb/updating.png" alt="Couch update view" />
#### Example body:
```json
[{"name":"tooljet"}]
```
Click on the `run` button to run the query.
:::info
NOTE: Query must be saved before running.
:::
Example response from CouchDb:
```json
{
"ok": true,
"id": "23212104e60a71edb42ebc509f0049a2",
"rev": "2-b0a625abc4e21ee554737920156e911f"
}
```
### Deleting a record
#### Required parameters:
- **Revision ID**
- **Record ID**
<img className="screenshot-full" src="/img/datasource-reference/couchdb/deleting.png" alt="Couch delete view"/>
Click on the `run` button to run the query.
Example response from CouchDb:
```json
{
"ok": true,
"id": "rev_id=2-3d01e0e87139c57e9bd083e48ecde13d&record_id=e33dc4e209689cb0400d095fc401a1e0",
"rev": "1-2b99ef28c03e68ea70bb668ee55ffb7b"
}
```
### Find
Find documents using a declarative JSON querying syntax.
#### Required parameters:
- **Selector**
:::info
NOTE:
selector syntax: https://pouchdb.com/guides/mango-queries.html
:::
<img className="screenshot-full" src="/img/datasource-reference/couchdb/find.png" alt="Couch find" />
#### Example body:
```json
{
"selector": {
"year": {"$gte": 2015}
},
"fields": ["year"]
}
```
Click on the `run` button to run the query.
:::info
NOTE:
selector (json) JSON object describing criteria used to select documents.
More information : https://docs.couchdb.org/en/stable/api/database/find.html
:::
Example response from CouchDb:
<img className="screenshot-full" src="/img/datasource-reference/couchdb/find_response.png" alt="Couch find response" />
### Retrieving a view
Views are the primary tool used for querying and reporting on CouchDB documents.
#### Required parameters:
- **View url**
Reference for view :https://docs.couchdb.org/en/3.2.0/ddocs/views/intro.html#what-is-a-view
<img className="screenshot-full" src="/img/datasource-reference/couchdb/get_view.png" alt="Couch get view" />
#### Optional parameters:
- **Start key**
- **End key**
- **Limit**
- **Skip**
Click on the `run` button to run the query.
:::info
startkey (json) Return records starting with the specified key.
endkey (json) Stop returning records when the specified key is reached.
limit (number) Limit the number of the returned documents to the specified number.
skip (number) Skip this number of records before starting to return the results. Default is 0.
:::
Example response from CouchDb:
```json
{
"total_rows": 4,
"offset": 0,
"rows": [
{
"id": "23212104e60a71edb42ebc509f000dc2",
"key": "23212104e60a71edb42ebc509f000dc2",
"value": {
"rev": "1-0cc7f48876f15883394e5c139c628123"
}
},
{
"id": "23212104e60a71edb42ebc509f00216e",
"key": "23212104e60a71edb42ebc509f00216e",
"value": {
"rev": "1-b3c45696b10cb08221a335ff7cbd8b7a"
}
},
{
"id": "23212104e60a71edb42ebc509f00282a",
"key": "23212104e60a71edb42ebc509f00282a",
"value": {
"rev": "1-da5732beb913ecbded309321cac892d2"
}
},
{
"id": "23212104e60a71edb42ebc509f002cbd",
"key": "23212104e60a71edb42ebc509f002cbd",
"value": {
"rev": "1-ca5bb3c0767eb42ea6c33eee3d395b59"
}
}
]
}
```

View file

@ -1,53 +0,0 @@
---
id: custom-js
title: Custom JavaScript
---
# Custom JavaScript
You can write custom JavaScript code to interact with components and queries. To do that, you just need to create a new query and select **Run JavaScript Code** from the data sources dropdown.
<img className="screenshot-full" src="/img/datasource-reference/custom-javascript/run-js.png" alt="custom js" />
#### Example: Displaying random number
- Let's drag a **button** and a **text** widget inside a container widget.
- Create a new query and select **Run JavaScript code** from dropdown.
- Write the code in **JavaScript editor** and save the query:
```jsx
const a = Math.floor(Math.random() * (10 - 1)) + 1;
return a;
```
:::tip
The return value is used as the `data` of the query.
:::
- Let's edit the properties of widgets:
- Add an event handler to the button - Select **On Click** event, **Run Query** action, and select the `runjs1` query that we created. This will run the JavaScript code every time the button is clicked.
- Edit the property of text widget - In the text field enter **Random number: `{{queries.runjs1.data}}`**. It will display the output as Random number: *result from JS code*
<img className="screenshot-full" src="/img/datasource-reference/custom-javascript/jsrandom.gif" alt="jsrandom" />
You can also write custom JavaScript code to get the data from **External APIs** and manipulate the response for graphical representation. Here's the [tutorial](https://blog.tooljet.com/build-github-stars-history-app-in-5-minutes-using-low-code/) on how we used custom JavaScript code to build an app using GitHub API.
### Libraries
ToolJet allows you to internally utilize these libraries:
| Name | Documentation |
| ----------- | ----------- |
| Moment | [https://momentjs.com/docs/](https://momentjs.com/docs/) |
| Lodash | [https://lodash.com/docs/](https://lodash.com/docs/) |
| Axios | [https://axios-http.com/docs/intro](https://axios-http.com/docs/intro) |
:::danger
Issues with writing custom JavaScript code? Ask in our [Slack Community](https://tooljet.com/slack).
:::

View file

@ -1,38 +0,0 @@
---
id: dynamodb
title: DynamoDB
---
# DynamoDB
ToolJet can connect to DynamoDB to read and write data.
## Connection
To add a new DynamoDB, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select DynamoDB from the modal that pops up.
ToolJet requires the following to connect to your DynamoDB.
- **Region**
- **Access key**
- **Secret key**
It is recommended to create a new IAM user for the database so that you can control the access levels of ToolJet.
<img className="screenshot-full" src="/img/datasource-reference/dynamo-connect.png" alt="ToolJet - Dynamo connection" height="250"/>
Click on 'Test connection' button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on 'Save' button to save the data source.
## Querying DynamoDB
Click on `+` button of the query manager at the bottom panel of the editor and select the database added in the previous step as the data source. Select the operation that you want to perform and click 'Save' to save the query.
<img className="screenshot-full" src="/img/datasource-reference/dynamo-query.png" alt="ToolJet - Dynamo query" height="250"/>
Click on the 'run' button to run the query. NOTE: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::

View file

@ -1,80 +0,0 @@
---
id: elasticsearch
title: Elasticsearch
---
# Elasticsearch
ToolJet can connect to your Elasticsearch cluster to read and write data.
## Connection
Please make sure the host/IP of the Elasticsearch cluster is accessible from your VPC if you have self-hosted ToolJet. If you are using ToolJet cloud, please **whitelist our IP**.
To add a new Elasticsearch database, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select Elasticsearch from the modal that pops up.
ToolJet requires the following to connect to your Elasticsearch cluster:
- **Host**
- **Port**
- **Username**
- **Password**
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/elasticsearch/connect.png" alt="Elastic connect" />
</div>
Elastic search datasource is also providing an option for connecting services with ssl certificates.
- You can either use CA / Client certificates option.
<img className="screenshot-full" src="/img/datasource-reference/elasticsearch/ssl.png" alt="Elastic ssl" />
## Querying Elasticsearch
Click on `+` button of the query manager at the bottom panel of the editor and select the Elasticsearch added in the previous step as the data source.
Select the operation that you want to perform on your Elasticsearch cluster and click `Create` to save the query.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/elasticsearch/query.png" alt="Elastic query" />
</div>
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::
## Supported operations
#### Search
This operation allows you to execute a search query and get back search hits that match the query. Read the Elasticsearch's `Search` guide **[here](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html)**.
<img className="screenshot-full" src="/img/datasource-reference/elasticsearch/elastic-search.png" alt="Elastic search" />
#### Index a document
This operation allows you to add a JSON document to the specified data stream or index. Read the Elasticsearch's `Index` guide **[here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html)**.
<img className="screenshot-full" src="/img/datasource-reference/elasticsearch/index.png" alt="Elastic index"/>
#### Get a document
This operation allows you to retrieve the specified JSON document from the index. Read the Elasticsearch's `Get` guide **[here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html)**.
<img className="screenshot-full" src="/img/datasource-reference/elasticsearch/get.png" alt="Elastic get"/>
#### Update a document
This operation allows to update a document using the specified script. Read the Elasticsearch's `Update` guide **[here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html)**.
<img className="screenshot-full" src="/img/datasource-reference/elasticsearch/update.png" alt="Elastic update" />

View file

@ -1,163 +0,0 @@
---
id: firestore
title: Cloud Firestore
---
# Cloud Firestore
## Connection
ToolJet connects to your Cloud Firestore using JSON key of your GCP service account.
To generate a new key, check out [Firestore's official documentation](https://cloud.google.com/iam/docs/creating-managing-service-account-keys#iam-service-account-keys-create-console).
Once the key is downloaded, click on `+` button of data sources panel at the left-bottom corner of the app editor. Select Firestore from the modal that pops up. Paste the key in the field for GCP key. Click on **Test connection** button to verify if the service account can access Firestore from ToolJet server. Click on **Save** button to save the datasource.
<img className="screenshot-full" src="/img/datasource-reference/firestore/add-ds-firestore.gif" alt="firestore add ds"/>
## Querying Firestore
Click on `+` button of the query manager at the bottom panel of the editor and select the database added in the previous step as the data source.
<img className="screenshot-full" src="/img/datasource-reference/firestore/firestore-query.png" alt="firestore QUERY" />
Select the operation that you want to perform on Firestore and click **Save** to save the query.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::
## Supported operations
1. [Get document](#get-document)
2. [Query collection](#query-collection)
3. [Add Document to Collection](#add-document-to-collection)
4. [Update document](#update-document)
5. [Set document](#set-document)
6. [Bulk update using document id](#bulk-update-using-document-id)
7. [Delete document](#delete-document)
### Get document
Use this operation to get the data in a document.
#### Required parameters:
- **Path**: Enter the path of the document. Path format: `collection name/document id`. ex: `books/23e2wsds32`
<img className="screenshot-full" src="/img/datasource-reference/firestore/get.png" alt="firestore get" />
### Query collection
Use this operation to query all the documents in a collection. Check firestore doc [here](https://firebase.google.com/docs/reference/js/v8/firebase.database.Query).
#### Required parameters:
- **Path**: Enter the name of the collection to be queried. Example: `books`
#### Optional parameters:
- **Order type**: Select ascending or descending from the dropdown.
- **Limit**: Maximum number of documents to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request. The Limit value should be of integer type.
- **Field, Operator, and Value**: For filtering the results, you can enter a document field name, use appropriate operator from the dropdown and set a value.
<img className="screenshot-full" src="/img/datasource-reference/firestore/query-collection.png" alt="firestore collection"/>
### Add Document to Collection
Use this operation for creating a new document in a collection.
#### Required parameters:
- **Collection**: Enter the path of the document in a collection. Path format: `collection name/document id`. ex: `books/33243dwe2332`
- **Body**: Enter the Field names and their values in json form. example body:
```json
{
"Author": "Shubh",
"id": 5
}
```
<img className="screenshot-full" src="/img/datasource-reference/firestore/add-document.png" alt="firestore document" />
### Update document
Use this operation for updating the existing document in a collection. Also, it only updates fields if they exist, but doesn't replace an entire object like [set operation](#set-document).
#### Required parameters:
- **Path**: Enter the path of the document in a collection. Path format: `collection name/document id`. ex: `books/33243dwe2332`
- **Body**: Enter the Field names and their values in json form. example body:
```json
{
"Author": "Shubhendra",
"id": 3
}
```
<img className="screenshot-full" src="/img/datasource-reference/firestore/update.png" alt="firestore update" />
### Set document
This operation replaces your chosen object with the value that you provide. So if your object has 5 fields, and you use Set operation and pass object with 3 fields, it will now have 3 fields.
#### Required parameters:
- **Path**: Enter the path of the document in a collection. Path format: `collection name/document id`. ex: `books/33243dwe2332`
- **Body**: Enter the Field names and their values in json form. example body:
```json
{
"Author": "Shefewfbh",
"id": 9
}
```
<img className="screenshot-full" src="/img/datasource-reference/firestore/set.png" alt="firestore set" />
### Bulk update using document id
Use this operation for bulk updating documents.
#### Required parameters:
- **Collection**:
- **Key for document ID**:
- **Records**:
<img className="screenshot-full" src="/img/datasource-reference/firestore/bulk.png" alt="firestore bulk" />
### Delete document
Use this operation for deleting a document in a collection.
#### Required parameters:
- **Path**: Enter the path of the document to be deleted in a collection. Path format: `collection name/document id`. ex: `books/33243dwe2332`
<img className="screenshot-full" src="/img/datasource-reference/firestore/delete.png" alt="firestore delete"/>
## Transforming firestore query result for Table widget
The Firestore query result is in the form of object so well need to transform it into array.
```js
return data = Array(data)
```

View file

@ -1,41 +0,0 @@
---
id: gcs
title: Google Cloud Storage
---
# Google Cloud Storage
ToolJet can connect to GCS buckets and perform various operation on them.
## Supported operations
-**Read file**
-**Upload file**
-**List buckets**
-**List files in a bucket**
-**Signed url for download**
-**Signed url for upload**
## Connection
To add a new GCS source, click on the **Add or edit datasource** icon on the left sidebar of the app editor and click on `Add datasource` button. Select GCS from the modal that pops up.
ToolJet requires the **json private key** of a service account to be able to connect to GCS.
You can follow the [google documentation](https://cloud.google.com/docs/authentication/getting-started) to get started.
<img className="screenshot-full" src="/img/datasource-reference/gcs-connect.png" alt="gcs connection" />
Click on **Test connection** button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying GCS
Click on `+` button of the **query manager** at the bottom panel of the editor and select the data source added in the previous step as the data source. Select the operation that you want to perform and click **Save** to save the query.
<img className="screenshot-full" src="/img/datasource-reference/gcs-query.png" alt="gcs query" />
Click on the **run** button to run the query.
**NOTE**: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::

View file

@ -1,112 +0,0 @@
---
id: google.sheets
title: Google Sheets
---
# Google Sheets
ToolJet can connect to Google Sheet using OAuth 2.0, which helps us to limit an application's access to a user's account.
## How to integrate Google Sheets
<iframe height="500" src="https://www.youtube.com/embed/3PO41waW2CQ" title="ToolJet Googlsheet Integration" frameborder="0" allowfullscreen width="100%"></iframe>
## Self-Hosted Configuration
If you are self-hosting the application, you will need to perform some additional steps.
1. Follow the [Google OAuth 2.0 setup steps outlined here](/docs/setup/env-vars#google-oauth--optional-)
2. Set the following environment variables with the values from the previous step:
* `GOOGLE_CLIENT_ID`
* `GOOGLE_CLIENT_SECRET`
* `TOOLJET_HOST`
3. Enable the Google Sheets API in the GCP console
## Authorization Scopes
You can create a Google Sheets data source with one of either of the two permission scopes :
1. **Read Only**
2. **Read and Write**
<img className="screenshot-full" src="/img/datasource-reference/google-sheets/googlesheets.gif" alt="google sheets" />
## Operations
Using Google sheets data source you can perform several operations from your applications like:
1. **[Read data from a sheet](#read-data-from-a-sheet)**
2. **[Append data to a sheet](#append-data-to-a-sheet)**
3. **[Update single row of a sheet](#update-single-row-of-a-sheet)**
4. **[Delete row from a sheet](#delete-row-from-a-sheet)**
5. **[Get spreadsheet info](#get-spreadsheet-info)**
### Read data from a sheet
This operation returns the table data from the spreadsheet in the form of json object.
| Fields | description |
| ----------- | ----------- |
| Spreadsheet ID | It is mandatory to enter the spreadsheet-id. The spreadsheet-id can be found in the URL of the spreadsheet. Example URL: https://docs.google.com/spreadsheets/d/1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM/edit#gid=0 - in this URL, the `1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM` is the spreadsheet-id. |
| Range | This is optional. You can specify the range of cells in this field. If left empty, it will select the range `A1:Z500`. |
| Sheet | This is optional. You can specify `sheet name` if it has more than 1 sheets, else it will automatically choose the first sheet. |
<img className="screenshot-full" src="/img/datasource-reference/google-sheets/read-data-op.png" alt="google sheets read"/>
### Append data to a sheet
You can add more rows to the table using the append operation.
| Fields | description |
| ----------- | ----------- |
| Spreadsheet ID | It is mandatory to enter the spreadsheet-id. The spreadsheet-id can be found in the URL of the spreadsheet. Example URL: https://docs.google.com/spreadsheets/d/1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM/edit#gid=0 - in this URL, the `1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM` is the spreadsheet-id. |
| Sheet | This is optional. You can specify `sheet name` if it has more than 1 sheets, else it will automatically choose the first sheet. |
| Rows | Enter the row data in the json array form. Each object in an array will represent a single row. Example: `[ {"name":"John", "email":"John@tooljet.com"},{...},{...} ]` In each object, the `key` represents the **column name** and the `value` represents the **cell data**. |
<img className="screenshot-full" src="/img/datasource-reference/google-sheets/append-data-op.png" alt="google sheets append" />
### Update single row of a sheet
You can update the existing data in sheet using this operation.
| Fields | description |
| ----------- | ----------- |
| Spreadsheet ID | It is mandatory to enter the spreadsheet-id. The spreadsheet-id can be found in the URL of the spreadsheet. Example URL: https://docs.google.com/spreadsheets/d/1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM/edit#gid=0 - in this URL, the `1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM` is the spreadsheet-id. |
| Where | Enter the column name such as `id` for choosing a row. |
| Operator | Choose the `===` operator to check the equality. |
| Value | Enter the any `id` number/name that you want to update. |
| Rows | Enter the row data. Example: `{{({id: components.textinput4.value, company: components.textinput1.value, position: components.textinput2.value, url: components.textinput3.value, 'date-applied': components.datepicker1.value, status: components.dropdown1.value})}}` |
<img className="screenshot-full" src="/img/datasource-reference/google-sheets/update-data-op.png" alt="google sheets update" />
### Delete row from a sheet
Use this operation delete a specific row from the sheet.
| Fields | description |
| ----------- | ----------- |
| Spreadsheet ID | It is mandatory to enter the spreadsheet-id. The spreadsheet-id can be found in the URL of the spreadsheet. Example URL: https://docs.google.com/spreadsheets/d/1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM/edit#gid=0 - in this URL, the `1W2S4re7zNaPk9vqv6_CqOpPdm_mDEqmLmzjVe7Nb9WM` is the spreadsheet-id. |
| GID | You'll find the GID in the end of the URL of spreadsheet. In the example mentioned above, the GID is 0 |
| Delete row number | Just enter the row number that you want to delete. |
<img className="screenshot-full" src="/img/datasource-reference/google-sheets/delete-row-op.png" alt="google sheets delete"/>
### Get spreadsheet info
This operation can be used to get some basic information of the spreadsheet such as the number of sheets, theme, time-zone, format, and url etc.
Here is the `Preview` of the query that used the get spreadsheet info operation.
<img className="screenshot-full" src="/img/datasource-reference/google-sheets/get-info2.png" alt="google sheets get info" />

View file

@ -1,47 +0,0 @@
---
id: graphql
title: GraphQL
---
# GraphQL
ToolJet can connect to GraphQL endpoints to execute queries and mutations.
## Connection
To add a new GraphQL datasource, click the `+` button on data sources panel at the bottom-left corner of the app builder and then select GraphQL from the modal that pops up.
ToolJet requires the following to connect to a GraphQL datasource:
- **URL of the GraphQL endpoint**
The following optional parameters are also supported:
| Type | Description |
| ----------- | ----------- |
| URL params | Additional query string parameters|
| headers | Any headers the GraphQL source requires|
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - GraphQl](/img/datasource-reference/graphql/graphql-ds.png)
</div>
Click on the **Save** button to save the data source.
## Querying GraphQL
Click on `+` button of the query manager at the bottom panel of the editor and select the GraphQL endpoint added in the previous step as the data source.
<img className="screenshot-full" src="/img/datasource-reference/graphql/graphql-query.png" alt="graphql query" />
Click on the 'run' button to run the query. NOTE: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::

View file

@ -1,129 +0,0 @@
---
id: influxdb
title: InfluxDB
---
# InfluxDB
ToolJet can connect to InfluxDB databases to read and write data. Use the Token authentication scheme to authenticate to the InfluxDB API. For more info visit [InfluxDB docs](https://docs.influxdata.com/).
## Connection
ToolJet connects to InfluxDB using :
- **API Token**
- **Host**
- **Port**
- **Protocol** (HTTP/HTTPS)
:::info
For generating API Token visit [InfluxDB docs](https://docs.influxdata.com/influxdb/cloud/security/tokens/create-token/).
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - influxDB](/img/datasource-reference/influxdb/influxauth.png)
</div>
## Supported queries:
- [Write data](#write-data)
- [Query data](#query-data)
- [Generate an Abstract Syntax Tree (AST) from a query](#generate-an-abstract-syntax-tree-ast-from-a-query)
- [Retrieve query suggestions](#retrieve-query-suggestions)
- [Retrieve query suggestions for a branching suggestion](#retrieve-query-suggestions-for-a-branching-suggestion)
- [Analyze a Flux query](#analyze-a-flux-query)
- [List buckets](#list-buckets)
- [Create a bucket](#create-a-bucket)
- [Retrieve a bucket](#retrieve-a-bucket)
- [Update a bucket](#update-a-bucket)
- [Delete a bucket](#delete-a-bucket)
<img className="screenshot-full" src="/img/datasource-reference/influxdb/operations.png" alt="influx operations" />
### Write data
This operation writes data to a bucket.
#### Required parameters:
- **Bucket**
- **Organization name or ID**
#### Optional parameters:
- **Precision**
### Query data
Retrieves data from InfluxDB buckets.
#### Required parameters:
- **Organization name or ID**
### Generate an Abstract Syntax Tree (AST) from a query
This operation analyzes flux query and generates a query specification.
#### Required parameters:
- **Query**
### Retrieve query suggestions
This query retrieve query suggestions.
### Retrieve query suggestions for a branching suggestion
This operation retrieve query suggestions for a branching suggestion.
#### Required parameters:
- **Name**
### Analyze a Flux query
This Analyzes a Flux query.
#### Required parameters:
- **Query**
### List buckets
This operation lists all the buckets in a database.
### Create a bucket
#### Required parameters:
- **Query**
### Retrieve a bucket
This operation retrieve a bucket in a database.
#### Required parameters:
- **Bucket ID**
### Update a bucket
#### Required parameters:
- **Bucket ID**
- **Query**
### Delete a bucket
#### Required parameters:
- **Bucket ID**

View file

@ -1,64 +0,0 @@
---
id: mailgun
title: Mailgun
---
# Mailgun
ToolJet can connect to your Mailgun account to send emails.
<img class="screenshot-full" src="/img/datasource-reference/mailgun/mailgun-datasource.png" alt="ToolJet - Data source - Mailgun" height="420" />
:::info
The Mailgun API Datasource supports for interaction with the mail endpoint of the [Mailgun API](https://documentation.mailgun.com/en/latest/api-intro.html#authentication-1).
:::
## Connection
To add a new Mailgun API datasource, click the **Datasource manager** icon on the left-sidebar of the app builder and click on the `Add datasource` button, then select Mailgun API from the modal that pops up.
Enter your **Mailgun API key** in the "API key" field.
:::tip
Mailgun API key is required to create an Mailgun datasource on ToolJet. You can generate API key by visiting [Mailgun account page](https://app.mailgun.com/app/account/security/api_keys).
:::
Click on the 'Save' button to save the data source.
## Supported operations
1. Email service
### Email service
Required parameters:
- Send email to
- Send email from
- Subject
- Body as text
Optional parameters:
- Body as HTML
<img class="screenshot-full" src="/img/datasource-reference/MailGun/mailgun_query_body.png" alt="ToolJet - Query Mailgun" height="420"/>
:::info
**Send mail to** - accepts a single email id.
For example:
`{{"dev@tooljet.io"}}`.
**Send mail from** - accepts a string.
For example: `admin@tooljet.io`
:::
:::tip
**Send a single email to multiple recipients** - The `Send mail to` field can contain an array of recipients, which will send a single email with all of the recipients in the field.
**Send multiple individual emails to multiple recipients** - set <b>Multiple recipients</b> field to `{{true}}` and the `Send mail to` field will be split into multiple emails and send to each recipient.
:::
:::note
NOTE: Query should be saved before running.
:::

View file

@ -1,49 +0,0 @@
---
id: mariadb
title: MariaDB
---
# MariaDB
ToolJet can connect to MariaDB to read and write data.
## Connection
To add a new MariaDB data source, click on the `+` button on datasources panel at the left sidebar of the app builder. Select MariaDB from the modal that pops up.
ToolJet requires the following to connect to your DynamoDB.
- **Host**
- **Username**
- **Password**
- **Connection Limit**
- **Port**
- **Database**
- **SSL**
- **SSL Certificate**
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/mariadb/connection.png" alt="MariaDB" />
</div>
Click on **Test connection** button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying MariaDB
Click on `+` button of the query manager at the bottom panel of the builder and select the MariaDB datasource added in the previous step.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/mariadb/query.png" alt="MariaDB query" />
</div>
Click on the **run** button to run the query.
**NOTE**: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::

View file

@ -1,51 +0,0 @@
---
id: minio
title: MinIO
---
# MinIO
ToolJet can connect to minio and perform various operation on them.
## Supported operations
- **Read object**
- **Put object**
- **Remove object**
- **List buckets**
- **List objects in a bucket**
- **Presigned url for download**
- **Presigned url for upload**
## Connection
To add a new minio source, click on the **Add or edit datasource** icon on the left sidebar of the app editor and click on `Add datasource` button. Select Minio from the modal that pops up.
ToolJet requires the following to connect to your DynamoDB:
- **Host**
- **Port**
- **Access key**
- **Secret key**
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/minio-connect.png" alt="miniIo connect" />
</div>
Click on **Test connection** button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying Minio
Click on `+` button of the **query manager** at the bottom panel of the editor and select the data source added in the previous step as the data source. Select the operation that you want to perform and click **Save** to save the query.
<img className="screenshot-full" src="/img/datasource-reference/minio-query.png" alt="miniIo query" />
Click on the **run** button to run the query.
**NOTE**: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::

View file

@ -1,109 +0,0 @@
---
id: mongodb
title: MongoDB
---
# MongoDB
ToolJet can connect to MongoDB to read and write data.
## Connection
Please make sure the host/ip of the database is accessible from your VPC if you have self-hosted ToolJet. If you are using ToolJet cloud, please whitelist our IP.
To add a new MongoDB, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select MongoDB from the modal that pops up.
ToolJet requires the following to connect to your MongoDB.
- **Host**
- **Port**
- **Username**
- **Password**
It is recommended to create a new MongoDB user so that you can control the access levels of ToolJet.
<img className="screenshot-full" src="/img/datasource-reference/mo-connect.png" alt="ToolJet - Mongo connection" height="250"/>
Click on 'Test connection' button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on 'Save' button to save the data source.
## Querying MongoDB
Click on `+` button of the query manager at the bottom panel of the editor and select the database added in the previous step as the data source. Select the operation that you want to perform and click 'Save' to save the query.
<img className="screenshot-full" src="/img/datasource-reference/mo-query.png" alt="ToolJet - Mongo query" height="250"/>
Click on the 'run' button to run the query. NOTE: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::
### Supported operations
- [List Collections](#list-collections)
- [Find One](#find-one)
- [Find Many](#find-many)
- [Total Count](#total-count)
- [Count](#count)
- [Distinct](#distinct)
- [Insert One](#insert-one)
- [Insert Many](#insert-many)
- [Update One](#update-one)
- [Update Many](#update-many)
- [Replace One](#replace-one)
- [Find One and Update](#find-one-and-update)
- [Find One and Replace](#find-one-and-replace)
- [Find One and Delete](#find-one-and-delete)
- [Aggregate](#aggregate)
- [Delete One](#delete-one)
- [Delete Many](#delete-many)
- [Bulk Operations](#bulk-operations)
#### List Collections
Returns list of collections
#### Find One
Return a document which satisfy the given filter and options. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/findOne)
#### Find Many
Return list of documents which satisfy the given filter and options. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/find/)
#### Total Count
Returns an estimation of the number of documents in the collection based on collection metadata. [Reference](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#estimateddocumentcount)
#### Count
Returns the number of documents based on the filter. [Reference](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#countdocuments)
#### Distinct
Retrieve a list of distinct values for a field based on the filter. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/distinct/)
#### Insert One
Insert a document. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/insertOne/)
#### Insert Many
Insert list of documents. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/insertMany/)
#### Update One
Update a document based on the filter. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/updateOne/)
#### Update Many
Update many documents based on the filter. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/updateMany/)
#### Replace One
Replace a document based on filter. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/replaceOne/)
#### Find One and Update
If your application requires the document after updating, use this instead of `Update One`. [Reference](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#findoneandupdate)
#### Find One and Replace
If your application requires the document after updating, use this instead of `Replace One`. [Reference](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#findoneandreplace)
#### Find One and Delete
If your application requires the document after deleting, use this instead of `Delete One`. [Reference](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#findoneanddelete)
#### Aggregate
Aggregation operations are expressions you can use to produce reduced and summarized results. [Reference](https://docs.mongodb.com/drivers/node/v4.0/fundamentals/aggregation/)
#### Delete One
Delete a record based on the filter. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/deleteOne/)
#### Delete Many
Delete many records based on the filter. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/deleteMany/)
#### Bulk Operations
Perform bulk operations. [Reference](https://docs.mongodb.com/drivers/node/v4.0/usage-examples/bulkWrite/)
### Dynamic Quries
```javascript
{ amount: { $lt: '{{ components.textinput1.value }}' }}
// Dates
// supported: Extended JSON syntax
{ createdAt: { $date: '{{ new Date('01/10/2020') }}'} }
// not supported: MongoDB classic syntax
{ createdAt: new Date('01/10/2020') }
```
Reference on [mongodb extended JSON](https://docs.mongodb.com/manual/reference/mongodb-extended-json/) supported data types

View file

@ -1,42 +0,0 @@
---
id: mssql
title: MS SQL Server / Azure SQL databases
---
# MS SQL Server / Azure SQL databases
ToolJet can connect to MS SQL Server & Azure SQL databases to read and write data.
## Connection
Please make sure the host/ip of the database is accessible from your VPC if you have self-hosted ToolJet. If you are using ToolJet cloud, please whitelist our IP.
To add new MS SQL Server / Azure SQL database, click on the '+' button on data sources panel at the left-bottom corner of the app editor. Select `SQL Server` from the modal that pops up.
ToolJet requires the following to connect to your PostgreSQL database.
- **Host**
- **Port**
- **Username**
- **Password**
- **Azure** - Select this option if you are using Azure SQL databases.
It is recommended to create a new database user so that you can control the access levels of ToolJet.
Click on 'Test connection' button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on 'Save' button to save the data source.
<img className="screenshot-full" src="/img/datasource-reference/mssql/connect.gif" alt="ToolJet - Redis connection" height="420"/>
## Querying SQL Server / Azure SQL databases
Click on '+' button of the query manager at the bottom panel of the editor and select the database added in the previous step as the data source.
Click on the 'run' button to run the query. NOTE: Query should be saved before running.
<img className="screenshot-full" src="/img/datasource-reference/mssql/query.gif" alt="ToolJet - Redis connection" height="420"/>
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::

View file

@ -1,65 +0,0 @@
---
id: mysql
title: MySQL
---
# MySQL
ToolJet can connect to MySQL databases to read and write data.
## Connection
ToolJet requires the following to connect to your MySQL database. Please make sure the host/ip of the database is accessible from your VPC if you have self-hosted ToolJet. If you are using ToolJet cloud, please whitelist our IP.
To add a new MySQL database, click on the `+` button on data sources panel at left sidebar in the app editor. Select MySQL from the modal that pops up.
ToolJet requires the following to connect to your MySQL database.
- **Host**
- **Port**
- **Username**
- **Password**
It is recommended to create a new MySQL database user so that you can control the access levels of ToolJet.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/mysql/mysql.png" alt="mysql"/>
</div>
Click on **Test connection** button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying MySQL
Once you have added a MySQL data source, click on `+` button of the query manager to create a new query. There are two modes by which you can query SQL:
1. **[SQL mode](/docs/data-sources/mysql#sql-mode)**
2. **[GUI mode](/docs/data-sources/mysql#gui-mode)**
#### SQL mode
SQL mode can be used to write raw SQL queries. Select SQL mode from the dropdown and enter the SQL query in the editor. Click on the `run` button to run the query.
**NOTE**: Query should be saved before running.
<img className="screenshot-full" src="/img/datasource-reference/mysql/mysql-sqlmode.png" alt="mysql mode" />
#### GUI mode
GUI mode can be used to query MySQL database without writing queries. Select GUI mode from the dropdown and then choose the operation **Bulk update using primary key**. Enter the **Table** name and **Primary key column** name. Now, in the editor enter the records in the form of an array of objects.
**Example**: `{{ [ {id: 1, channel: 33}, {id:2, channel:24} ] }}`
<img className="screenshot-full" src="/img/datasource-reference/mysql/mysql-guimode.png" alt="mysql gui mode" />
Click on the **run** button to run the query. **NOTE**: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::

View file

@ -1,51 +0,0 @@
---
id: n8n
title: n8n
---
# n8n
ToolJet can trigger n8n workflows using webhook URLs. Please refer [this](https://docs.n8n.io/) to know more about n8n.
## Connection
Go to the data source manager on the left sidebar and click on `+` button to add new data source. Select n8n from the list of available data sources in the modal that pops-up.
n8n webhooks can be called with or without an **Authentication**. You can keep the `Authentication type` as `none` if your webhook didn't have one or if it has one then you can choose the one from the dropdown and provide credentials:
#### Authentication Types
- **Basic Auth**: To connect your n8n webhooks using basic auth you'll need to provide the following credentials:
- **Username**
- **Password**
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/n8n/basicauth.png" alt="n8n basicauth" />
</div>
- **Header Auth**: To connect your n8n webhooks using header auth the following fields are required:
- **Name / Key**
- **Value**
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/n8n/headerauth.png" alt="n8n headerauth" />
</div>
:::tip
Webhook credentials and instance credentials are different. Please use the credentials that you use with the webhook trigger. Know more: **[Webhook Authentication](https://docs.n8n.io/nodes/n8n-nodes-base.webhook/#:~:text=then%20gets%20deactivated.-,Authentication,-%3A%20The%20Webhook%20node)**.
:::
## Trigger Workflow
Click on `+` button of the query manager at the bottom panel of the editor and the select n8n as the datasource.
You can trigger a workflow with `GET/POST` URL. Choose the request type from the `Methods` dropdown and then provide the required fields:
- **URL parameters** (Support for GET & POST) `Optional`
- **Body** (Only for POST URL) `Required`
<img className="screenshot-full" src="/img/datasource-reference/n8n/query.png" alt="n8n query" />

View file

@ -1,234 +0,0 @@
---
id: notion
title: Notion
---
# Notion
ToolJet can connect to a Notion workspace to do operations on notion pages, databases and blocks.
## Connection
For integrating Notion with ToolJet we will need the API token. The API token can be generated from your Notion workspace settings. Read the official Notion docs for [Creating an internal integration with notion API](https://www.notion.so/help/create-integrations-with-the-notion-api).
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/notion/api.png" alt="notion api" />
</div>
## Querying Notion
Notion API provides support for:
- **[Database](#database)**
- **[Page](#page)**
- **[Block](#blocks)**
- **[User](#user)**
<img className="screenshot-full" src="/img/datasource-reference/notion/querying.png" alt="notion querying"/>
:::tip
Before querying Notion, you must share the database with your integration. Click the share button in your database view, find your integration name select it.
<img className="screenshot-full" src="/img/datasource-reference/notion/share.png" alt="notion share"/>
:::
### Database
On database resource you can perform the following operations:
- **[Retrieve a database](#1-retrieve-a-database)**
- **[Query a database](#2-query-a-database)**
- **[Create a database](#3-create-a-database)**
- **[Update a database](#4-update-a-database)**
<img className="screenshot-full" src="/img/datasource-reference/notion/db_q.png" alt="notion db" />
#### 1. Retrieve a database
This operations retrieves a Database object using the ID specified.
##### Required parameters:
- **Database ID**: You'll find the Database ID in the url. Suppose this is the example url: `https://www.notion.so/workspace/XXX?v=YYY&p=ZZZ` then `XXX` is the database ID, `YYY` is the view ID and `ZZZ` is the page ID.
<img className="screenshot-full" src="/img/datasource-reference/notion/db_retrieve.png" alt="notion db retreieve" />
#### 2. Query a database
This operation gets a list of **Pages** contained in the database, filtered and ordered according to the filter conditions and sort criteria provided in the query.
##### Required parameters:
- **Database ID** : You'll find the Database ID in the url. Suppose this is the example url: `https://www.notion.so/workspace/XXX?v=YYY&p=ZZZ` then `XXX` is the database ID, `YYY` is the view ID and `ZZZ` is the page ID.
##### Optional parameters:
- **Filter** : This must be an object of filters
- **Sort** : Array of sort objects
- **Limit** : limit for pagination
- **Start Cursor** : Next object id to continue pagination
#### 3. Create a database
This operation creates a database as a subpage in the specified parent page, with the specified properties.
##### Required parameters:
- **Database ID** : You'll find the Database ID in the url. Suppose this is the example url: `https://www.notion.so/workspace/XXX?v=YYY&p=ZZZ` then `XXX` is the database ID, `YYY` is the view ID and `ZZZ` is the page ID.
- **Page ID** : Page ID of the parent
- **Properties** : Properties defines the columns in a database
##### Optional parameters:
- **Title** : Title should be an array of rich_text properties
- **Icon type** : Currently notion api accepts two icon options, emoji, external URL
- **Icon value** : Value of selected icon type
- **Icon type** : Currently notion api accepts only external URL
- **Cover value** : Value of selected cover type
#### 4. Update a database
This operation updates an existing database as specified by the parameters.
##### Required parameters:
- **Database ID**
##### Optional parameters:
- **Title** : Title should be an array of rich_text properties
- **Properties** : Properties defines the columns in a database
- **Icon type** : Currently notion api accepts two icon options, emoji, external URL
- **Icon value** : Value of selected icon type
- **Icon type** : Currently notion api accepts only external URL
- **Cover value** : Value of selected cover type
### Page
On page resource you can perform the following operations:
- **[Retrieve a page](#1-retrieve-a-page)**
- **[Create a page](#2-create-a-page)**
- **[Update a page](#3-update-a-page)**
- **[Retrieve a page property](#4-retrieve-a-page-property-item)**
- **[Archive a page](#5-archive-delete-a-page)**
<img className="screenshot-full" src="/img/datasource-reference/notion/page_q.png" alt="notion page" />
#### 1. Retrieve a page
This operation retrieves a **Page** object using the ID specified.
##### Required parameters:
- **Page ID**
#### 2. Create a page
This operation creates a new page in the specified database or as a child of an existing page. If the parent is a database, the property values of the new page in the properties parameter must conform to the parent database's property schema. If the parent is a page, the only valid property is title.
##### Parameters:
- **Page ID**
- **Properties** : Property values of this page
- **Icon type** : Currently notion api accepts two icon options, emoji, external URL
- **Icon value**: Value of selected icon type
- **Icon type** : Currently notion api accepts only external URL
- **Cover value** : Value of selected cover type
#### 3. Update a page
This operation updates page property values for the specified page. Properties that are not set via the properties parameter will remain unchanged.
##### Parameters:
- **Page ID**
- **Parent type**: A database parent or page parent
- **Properties** : Property values of this page
- **Children** : Page content for the new page as an array of block objects
- **Icon type** : Currently notion api accepts two icon options, emoji, external URL
- **Icon value**: Value of selected icon type
- **Icon type** : Currently notion api accepts only external URL
- **Cover value** : Value of selected cover type
#### 4. Retrieve a page property item
This operation retrieves a property_item object for a given page ID and property ID. Depending on the property type, the object returned will either be a value or a paginated list of property item values. See Property item objects for specifics.
##### Parameters:
- **Page ID**
- **Property ID**
- **Limit**
- **Start cursor**
#### 5. Archive (delete) a page
##### Required parameters:
- **Page ID**
- **Archive**: Dropdown for archive and un archive the page
### Blocks
The following operations can be performed on the block resource:
- **[Retrieve a block](#1-retrieve-a-block)**
- **[Append block children](#2-append-new-block-children)**
- **[Retrieve block children](#3-retrieve-block-children)**
- **[Update a block](#4-update-a-block)**
- **[Delete a block](#5-delete-a-block)**
<img className="screenshot-full" src="/img/datasource-reference/notion/block_q.png" alt="notion block" />
:::info
To get the id for blocks, simply click on the menu icon for the block and click "Copy link". Afterwards, paste the link in the browser and it should look like this: `https://www.notion.so/Creating-Page-Sample-ee18b8779ae54f358b09221d6665ee15#7fcb3940a1264aadb2ad4ee9ffe11b0e` the string after **#** is the block id i.e. `7fcb3940a1264aadb2ad4ee9ffe11b0e`.
:::
#### 1. Retrieve a block
This operation retrieves a **Block** object using the ID specified.
##### Required parameters:
- **Block ID**
#### 2. Append new block children
This operation creates and appends new children blocks to the parent block_id specified.
##### Required parameters:
- **Block ID**
- **Children**: Array of block objects
#### 3. Retrieve block children
This operation retrieves a paginated array of child block objects contained in the block using the ID specified.
##### Required parameters:
- **Block ID**
- **Limit**
- **Start cursor**
#### 4. Update a block
This operation updates the content for the specified block_id based on the block type.
##### Required parameters:
- **Block ID**
- **Properties**: The block object type value with the properties to be updated
- **Archive**
#### 5. Delete a block
##### Required parameters:
- **Block ID**
### User
The following operations can be performed on the user notion resource:
#### 1. Retrieve a user from current workspace
This operation retrieves a User using the ID specified.
<img className="screenshot-full" src="/img/datasource-reference/notion/user_q.png" alt="notion user" />
##### Required parameters:
- **User ID**
#### 2. Retrieve list of users of a workspace
This operation returns a paginated list of Users for the workspace.
##### Required parameters:
- **Limit**
- **Start cursor**
[Read more about notion API](https://developers.notion.com/reference/intro)

View file

@ -1,25 +0,0 @@
---
id: openapi
title: OpenAPI
---
# OpenAPI
ToolJet has a data source for generating REST API operations from OpenAPI Specs.
## Connection
- Connections are generated from OpenAPI specifications. Currently supports Basic Auth, API Key, Bearer Token, OAuth 2.0
- Also supports specifications with multiple authentications
[Read more](https://swagger.io/docs/specification/authentication/)
## Querying OpenAPI
- Operations will be generated from specifications and each one will be different from other
### Common fields
- Host (Base URL)
Some specs can have one or more base URLs/servers and specific operations may have separate Base URLs. So you can select the URL from the host select
- Operation

View file

@ -1,53 +0,0 @@
---
id: oracledb
title: Oracle DB
---
# Oracle DB
ToolJet can connect to Oracle databases to read and write data.
## Connection
A Oracle DB can be connected with the following credentails:
- **Host**
- **Port**
- **SID / Service Name** ( Database name must be a SID / Service Name )
- **Database Name**
- **SSL**
- **Username**
- **Password**
- **Client Library Path** ( Only required for local setup )
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - OracleDB](/img/datasource-reference/oracledb/oracleauth.png)
</div>
Click on **Test connection** button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying Oracle DB
Once you have added a Oracle DB data source, click on `+` button of the query manager to create a new query. There are two modes by which you can query SQL:
1. **[SQL mode](/docs/data-sources/oracledb#sql-mode)**
2. **[GUI mode](/docs/data-sources/oracledb#gui-mode)**
#### SQL mode
SQL mode can be used to write raw SQL queries. Select SQL mode from the dropdown and enter the SQL query in the editor. Click on the `run` button to run the query.
**NOTE**: Query should be saved before running.
#### GUI mode
GUI mode can be used to query Oracle database without writing queries. Select GUI mode from the dropdown and then choose the operation **Bulk update using primary key**. Enter the **Table** name and **Primary key column** name. Now, in the editor enter the records in the form of an array of objects.
**Example**: `{{ [ {id: 1, channel: 33}, {id:2, channel:24} ] }}`
Click on the **run** button to run the query. **NOTE**: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::

View file

@ -1,57 +0,0 @@
---
id: postgresql
title: PostgreSQL
---
# PostgreSQL
ToolJet can connect to PostgreSQL databases to read and write data.
## Connection
Please make sure the host/ip of the database is accessible from your VPC if you have self-hosted ToolJet. If you are using ToolJet cloud, please whitelist our IP.
To add a new PostgreSQL database, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select PostgreSQL from the modal that pops up.
ToolJet requires the following to connect to your PostgreSQL database.
- **Host**
- **Port**
- **Username**
- **Password**
It is recommended to create a new PostgreSQL database user so that you can control the access levels of ToolJet.
<img className="screenshot-full" src="/img/datasource-reference/postgresql/pgconnect.png" alt="ppg connect" />
Click on **Test connection** button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying PostgreSQL
Click on `+` button of the query manager at the bottom panel of the editor and select the database added in the previous step as the data source. PostgreSQL query editor has two modes, SQL & GUI. **[SQL mode](/docs/data-sources/postgresql#sql-mode)** can be used to write raw SQL queries and **[GUI mode](/docs/data-sources/postgresql#gui-mode)** can be used to query your PostgreSQL database without writing queries.
#### SQL mode
Select SQL mode from the dropdown and enter the query in the editor. Click on the `run` button to run the query.
**NOTE**: Query should be saved before running.
<img className="screenshot-full" src="/img/datasource-reference/postgresql/pg-sql.png" alt="ppg sql" />
#### GUI mode
Select GUI mode from the dropdown and then choose the operation **Bulk update using primary key**. Enter the **Table** name and **Primary key column** name. Now, in the editor enter the **records** in the form of an array of objects.
Click on the `run` button to run the query. **NOTE**: Query should be saved before running.
<img className="screenshot-full" src="/img/datasource-reference/postgresql/pg-gui.png" alt="ppg gui" />
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::

View file

@ -1,80 +0,0 @@
---
id: redis
title: Redis
---
# Redis
ToolJet can run Redis commands on your Redis instances.
## Connection
ToolJet requires the following to connect to your Redis instances.
<img class="screenshot-full" src="/img/redis/connect.png" alt="ToolJet - Redis connection" height="250"/>
- **Host**
- **Port** - The default port for Redis server is 6379
- **Username**
- **Password**
Click on "Test" button to test the connection and click "Save" to save the data source.
## Redis Queries
Here are some examples of Redis commands and their usage. You can refer to the [Redis Official Documentation](https://redis.io/commands) for a complete list of supported commands.
### PING Command
The `PING` command is used to test the connection to Redis. If the connection is successful, the Redis server will respond with `PONG`.
```shell
PING
```
### SET Command
The `SET` command is used in Redis to assign a value to a specific key.
```shell
SET key value
```
**Example 1/2:**
When the input value contains spaces, you should encode the value before providing it as an input:
```shell
SET products {{encodeURI('John Doe')}}
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/redis/encode.png" alt="Redis" />
</div>
### GET Command
The `GET` command is used in Redis to retrieve the value associated with a specific key.
```shell
GET key
```
**Example 2/2:**
To retrieve a value that was previously encoded while setting, you can use transformations.
- Enter the GET command in the editor:
```shell
GET products
```
- Enable Transformations (JS) and use `decodeURI`:
```js
return JSON.parse(decodeURI(data));
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/redis/decode.png" alt="Redis" />
</div>

View file

@ -1,46 +0,0 @@
---
id: restapi
title: REST API
---
# REST API
ToolJet can connect to any REST endpoint available.
## Connection
To add a new REST API datasource, click the Datasources manager icon on the left-sidebar of the app builder and click on the `Add datasource` button, then select REST API from the modal that pops up.
Click on the 'Save' button to save the data source.
<img class="screenshot-full" src="/img/datasource-reference/rest-api/rest-api.gif" alt="ToolJet - Data source - REST API" height="420"/>
ToolJet requires the following to connect to a REST API datasource.
- URL of the REST endpoint
The following optional parameters are also supported:
| Type | Description |
| ----------- | ----------- |
| URL params | Additional query string parameters|
| headers | Any headers the REST API source requires|
| body | Any values or fields the REST API source requires|
:::info
REST HTTP methods that are supported are **GET, POST, PUT, PATCH &amp; DELETE**.
:::
<img class="screenshot-full" src="/img/datasource-reference/rest-api/rest-api-values.gif" alt="ToolJet - Data source - REST API" height="420"/>
## Querying REST API
Click on `+` button of the query manager at the bottom panel of the editor and select the REST API endpoint added in the previous step as the data source.
Click on the 'run' button to run the query.
:::note
NOTE: Query should be saved before running.
:::
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::

View file

@ -1,52 +0,0 @@
---
id: rethinkdb
title: RethinkDB
---
# RethinkDB
ToolJet can connect to RethinkDB databases to read and write data. For more info visit::https://rethinkdb.com/api/javascript
<img class="screenshot-full" src="/img/datasource-reference/rethink/rethink_auth.png" alt="ToolJet - Data source - RethinkDB" height="420" />
## Connection
ToolJet connects to InfluxDB using :
- **Database**
- **Host**
- **Port**
- **Username**
- **Password**
## Supported queries:
- Delete database
- Delete Table
- Create database
- Create Table
- List table
- List database
- Get all documents
- Insert table data
- Update all table data
- Update by id
- Delete table data by id
- Delete all table data
- Get document from primary key
:::info
NOTE: Name field in all operation is database name if not given will take the default database used for connection.
:::

View file

@ -1,132 +0,0 @@
---
id: s3
title: Amazon S3
---
# Amazon S3
ToolJet can connect to Amazon S3 buckets and perform various operation on them.
## Connection
To add a new S3 source, go to the **Datasources manager** on the left sidebar of the app editor and click on `Add datasource` button. Select **AWS S3** from the modal that pops up.
ToolJet requires the following to connect to your AWS S3:
- **Region**
- **Access key**
- **Secret key**
It is recommended to create a new IAM user for the database so that you can control the access levels of ToolJet.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/aws-s3/aws-s3-modal.png" alt="aws s3 modal" />
</div>
Click on **Test connection** button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying AWS S3
Click on `+` button of the **query manager** at the bottom panel of the editor and select the data source added in the previous step as the data source. Select the operation that you want to perform and click **Save** to save the query.
<img className="screenshot-full" src="/img/datasource-reference/aws-s3/aws-s3-query.png" alt="aws s3 query" />
Click on the **run** button to run the query.
**NOTE**: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::
## Query operations
You can create query for AWS S3 data source to perform several actions such as:
1. **[Read object](/docs/data-sources/s3#read-object)**
2. **[Upload object](/docs/data-sources/s3#upload-object)**
3. **[List buckets](/docs/data-sources/s3#list-buckets)**
4. **[List objects in a bucket](/docs/data-sources/s3#list-objects-in-a-bucket)**
5. **[Signed url for download](/docs/data-sources/s3#signed-url-for-download)**
6. **[Signed url for upload](/docs/data-sources/s3#signed-url-for-upload)**
### Read object
You can read an object in a bucket by using this operation. It requires two parameters - **Bucket** name and **Key**.
<img className="screenshot-full" src="/img/datasource-reference/aws-s3/read-object.png" alt="aws s3 read object" />
### Upload object
You can use this operation to upload objects(files) to your S3 bucket. It requires four parameters:
1. **Bucket**: Specify the bucket name
2. **Key**: Key of the object/file
3. **Content type**: Specify file type such as text, image etc.
4. **Upload data**: File/object that is to be uploaded.
<img className="screenshot-full" src="/img/datasource-reference/aws-s3/upload-object.png" alt="aws s3 upload"/>
### List buckets
This operation will list all the buckets in your S3. This does not require any parameter.
<img className="screenshot-full" src="/img/datasource-reference/aws-s3/list-buckets.png" alt="aws s3 bucket" />
### List objects in a bucket
This operation will fetch the list of all the files in your bucket. It requires two parameters:
1. **Bucket**: Bucket name (mandatory)
2. **Prefix**: To limit the response to keys that begin with the specified prefix (optional)
3. **Max keys**: The maximum number of keys returned in the response body (optional). Default value is 1000.
4. **Offset**: The key to start with when listing objects in a bucket (optional).
5. **"Next Continuation Token"**: `Next Continuation Token` indicates Amazon S3 that the list is being continued on this bucket with a token. ContinuationToken is obfuscated and is not a real key (optional).
:::info
**Next Continuation Token**
For listing a bucket for objects that begin with a specific character or a prefix, then use the `Offset` parameter. For example, if you want to list all the objects that begin with `a`, then set the `Offset` parameter to `a`. Similarly, if you want to list all the objects that begin with `ab`, then set the `Offset` parameter to `ab`.
The `Next Continuation Token` is used to list the next set of objects in a bucket. It is returned by the API when the response is truncated. The results will contain `Next Continuation Token` if there are more keys in the bucket that satisfy the list query. To get the next set of objects, set the `Next Continuation Token` parameter and run the query again.
The results will continue from where the last listing finished.
:::
<img className="screenshot-full" src="/img/datasource-reference/aws-s3/listbuckets.png" alt="aws s3 list object" />
### Signed url for download
The object owner can optionally share objects with others by creating a presigned URL, using their own security credentials, to grant time-limited permission to download the objects. For creating a presigned URL, the required parameters are:
1. **Bucket**: name of the bucket for uploading the file
2. **Key**: an object key
3. **Expires in**: an expiration time of URL
<img className="screenshot-full" src="/img/datasource-reference/aws-s3/signed-download.png" alt="aws s3 signed download" />
### Signed url for upload
The presigned URLs are useful if you want your user/customer to be able to upload a specific object to your bucket, but you don't require them to have AWS security credentials or permissions. For creating a presigned URL, the required parameters are:
1. **Bucket**: name of the bucket for uploading the file
2. **Key**: an object key
3. **Expires in**: an expiration time of URL
4. **Content type**: the content type such as text, image etc.
<img className="screenshot-full" src="/img/datasource-reference/aws-s3/signed-upload.png" alt="aws s3 signed upload" />
:::info
We built an app to view and upload files to AWS S3 buckets. Check out the complete tutorial **[here](https://blog.tooljet.com/building-an-app-to-view-and-upload-files-in-aws-s3-bucket/)**.
:::

View file

@ -1,48 +0,0 @@
---
id: saphana
title: SAP HANA
---
# SAP HANA
ToolJet can connect to SAP HANA databases to read and write data.
- [Connection](#connection)
- [Querying SAP HANA](#querying-sap-hana)
## Connection
To add a new SAP HANA database, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select SAP HANA from the modal that pops up.
ToolJet requires the following to connect to your SAP HANA database:
- **Host**
- **Port**
- **Username**
- **Password**
:::info
Please make sure the host/ip of the database is accessible from your VPC if you have self-hosted ToolJet. If you are using ToolJet cloud, please whitelist our IP.
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - SAP HANA](/img/datasource-reference/saphana/connect.png)
</div>
Click on **Test connection** button to verify if the credentials are correct and that the database is accessible to ToolJet server. Click on **Save** button to save the data source.
## Querying SAP HANA
Click on `+` button of the query manager at the bottom panel of the editor and select the database added in the previous step as the data source. Enter the query in the editor. Click on the `run` button to run the query.
**NOTE**: Query should be saved before running.
<img className="screenshot-full" src="/img/datasource-reference/saphana/query.png" alt="saphana query" />
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::

View file

@ -1,62 +0,0 @@
---
id: sendgrid
title: SendGrid
---
# SendGrid
ToolJet can connect to your SendGrid account to send emails.
<img class="screenshot-full" src="/img/datasource-reference/sendgrid/sendgrid-datasource.png" alt="ToolJet - Data source - SendGrid" height="420" />
:::info
The SendGrid API Datasource supports for interaction with the mail endpoint of the [SendGrid v3 API](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authentication).
:::
## Connection
To add a new SendGrid API datasource, click the **Datasource manager** icon on the left-sidebar of the app builder and click on the `Add datasource` button, then select SendGrid API from the modal that pops up.
Enter your **SendGrid API key** in the "API key" field.
:::tip
SendGrid API key is required to create an SendGrid datasource on ToolJet. You can generate API key by visiting [SendGrid account page](https://app.sendgrid.com/settings/api_keys).
:::
Click on the 'Save' button to save the data source.
## Supported operations
1. Email service
### Email service
Required parameters:
- Send email to
- Send email from
- Subject
- Body as text
Optional parameters:
- Body as HTML
<img class="screenshot-full" src="/img/datasource-reference/sendgrid/sendgrid-query.jpg" alt="ToolJet - Query SendGrid" height="420"/>
:::info
**Send mail to** - accepts an array/list of emails separated by comma.
For example:
`{{["dev@tooljet.io", "admin@tooljet.io"]}}`.
**Send mail from** - accepts a string.
For example: `admin@tooljet.io`
:::
:::tip
**Send a single email to multiple recipients** - The `Send mail to` field can contain an array of recipients, which will send a single email with all of the recipients in the field.
**Send multiple individual emails to multiple recipients** - set <b>Multiple recipients</b> field to `{{true}}` and the `Send mail to` field will be split into multiple emails and send to each recipient.
:::
:::note
NOTE: Query should be saved before running.
:::

View file

@ -1,67 +0,0 @@
---
id: slack
title: Slack
---
# Slack
ToolJet can connect to your Slack workspace to send messages.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Slack](/img/datasource-reference/slack/connect.png)
</div>
## Connection
- To add the Slack datasource, click the **Datasource manager** icon on the left-sidebar of the app builder and click on the `Add datasource` button, then select Slack from the modal that pops up.
- In the next dialog, you'll be asked to choose the **permission scope**. Choose the permission scope and then click on **Connect to Slack** button.
- A new tab will open up asking for authorization confirmation. Once done, you can close the tab.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Slack](/img/datasource-reference/slack/authorize.png)
</div>
- Click on the '**Save data source** button to save the data source.
:::note
The App (which credentials are provided) needs to be installed in the workspace to use the Slack data source, and it needs to be added to the channel where you want to post the message.
:::
## Supported operations
1. **List members**
2. **Send message**
### List members
This operation will return the data of all the members in your slack workspace.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Slack](/img/datasource-reference/slack/listmembers.png)
</div>
### Send message
This operation will send/post the message to a specified channel or posting to direct messages (also known as DMs or IMs) in your slack workspace.
| Property | Description |
| :--- | :--- |
| Channel | The channel ID or user ID to post the message to. |
| Message | The message to post. |
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Slack](/img/datasource-reference/slack/sendmessage.png)
</div>

View file

@ -1,48 +0,0 @@
---
id: smtp
title: SMTP
---
# SMTP
SMTP plugin can connect ToolJet applications to **SMTP servers** for sending emails.
## Connection
A SMTP server can be connected with the following credentails:
- **Host**
- **Port**
- **User**
- **Password**
:::info
You can also test your connection before saving the configuration by clicking on `Test Connection` button.
:::
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/smtp/connect.png" alt="smtp connect" />
</div>
## Querying SMTP
Go to the query manager at the bottom panel of the editor and click on the `+` button on the left to create a new query. Select `SMTP` from the datasource dropdown.
To create a query for sending email, you will need to provide the following properties:
- **From** `required` : Email address of the sender
- **From Name** : Name of the sender
- **To** `required` : Recipient's email address
- **Subject** : Subject of the email
<img className="screenshot-full" src="/img/datasource-reference/smtp/query1.png" alt="smtp query1" />
- **Body** : You can enter the body text either in the form of `raw text` or `html` in their respective fields.
- **Attachments** : Attachments can be added to a SMTP query by referencing the file from the `File Picker` component in the attachments field.
For example, you can set the `Attachments` field value to `{{ components.filepicker1.file }}` or you can pass an object `{{ name: 'filename.jpg', dataURL: '......' }}` to accomplish this.
<img className="screenshot-full" src="/img/datasource-reference/smtp/query2.png" alt="smtp query2" />

View file

@ -1,52 +0,0 @@
---
id: snowflake
title: Snowflake
---
# Snowflake
ToolJet can connect to Snowflake databases to read and write data.
- [Connection](#connection)
- [Getting Started](#querying-snowflake)
## Connection
Please make sure the host/ip of the database is accessible from your VPC if you have self-hosted ToolJet. If you are using ToolJet cloud, please whitelist our IP. You can find snowflake docs on network policies **[here](https://docs.snowflake.com/en/user-guide/network-policies.html)**.
To add a new Snowflake database, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select Snowflake from the modal that pops up.
ToolJet requires the following to connect to your Snowflake database.
- **Account**
- **Username**
- **Password**
:::info
You can also configure for **[additional optional parameters](https://docs.snowflake.com/en/user-guide/nodejs-driver-use.html#additional-connection-options)**.
:::
<div style={{textAlign: 'center'}}>
![ToolJet - Snowflake connection](/img/datasource-reference/snowflake/snowflake-connect.png)
</div>
## Querying Snowflake
Click on `+` button of the query manager at the bottom panel of the editor and select the database added in the previous step as the datasource. Query manager then can be used to write raw SQL queries.
<div style={{textAlign: 'center'}}>
![ToolJet - Snowflake query](/img/datasource-reference/snowflake/snowflake-query.png)
</div>
Click on the `run` button to run the query.
**NOTE:** Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: [link](/docs/tutorial/transformations)
:::

View file

@ -1,192 +0,0 @@
---
id: stripe
title: Stripe
---
# Stripe
ToolJet can connect to your Stripe account to read or write customers' and payments' data.
:::info
Check out the **[Stripe Refund App tutorial](https://blog.tooljet.com/build-a-stripe-refund-tool-using-low-code/)**
:::
## Connection
To add a new Stripe data source, click on the `+` button on data sources panel at the left-bottom corner of the app editor. Select Stripe from the modal that pops up.
ToolJet requires the **Stripe API key** to connect to your database.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Stripe](/img/datasource-reference/stripe/connect.png)
</div>
You can get the Stripe API key from the dashboard of your Stripe account. Go to the Stripe account dashboard, click on the **Developers** on the top right, then on the left-sidebar go to the **API Keys**, you can simple reveal the **Secret Key** and copy-paste on ToolJet.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Stripe](/img/datasource-reference/stripe/apikey.png)
</div>
## Querying Stripe
Click on **+** button of the query manager at the bottom panel of the editor and select the Stripe datasource added in the previous step. Enter the query in the editor. Click on the `Save and Run` button to save and then run the query.
**NOTE**: Query should be saved before running.
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::
## Supported operations
You can check out the some of the operations mentioned below. All the operations for Stripe are available and can be performed from ToolJet. Check out the **[Stripe API documentation](https://stripe.com/docs/api/)** for the detailed information about each operation.
- **delete,/v1/account**
- **get,/v1/account**
- **post,/v1/account**
- **post,/v1/account/bank_accounts**
- **delete,/v1/account/bank_accounts/`{id}`**
- **get,/v1/account/bank_accounts/`{id}`**
- **post,/v1/account/bank_accounts/`{id}`**
- **get,/v1/account/capabilities**
- **get,/v1/account/capabilities/`{capability}`**
- **post,/v1/account/capabilities/`{capability}`**
- **get,/v1/account/external_accounts**
- **post,/v1/account/external_accounts**
- **delete,/v1/account/external_accounts/`{id}`**
- **get,/v1/account/external_accounts/`{id}`**
- **post,/v1/account/external_accounts/`{id}`**
- **post,/v1/account/login_links**
- **get,/v1/account/people**
- **post,/v1/account/people**
- **delete,/v1/account/people/`{person}`**
- **get,/v1/account/people/`{person}`**
- **post,/v1/account/persons**
- **delete,/v1/account/persons/`{person}`**
- **get,/v1/account/persons/`{person}`**
- **post,/v1/account/persons/`{person}`**
- **post,/v1/account_links**
- **get,/v1/accounts**
- **post,/v1/accounts**
- **delete,/v1/accounts/`{account}`**
- **get,/v1/accounts/`{account}`**
- **post,/v1/accounts/`{account}`**
- **post,/v1/accounts/`{account}`/bank_accounts**
- **delete,/v1/accounts/`{account}`/bank_accounts/`{id}`**
- **get,/v1/accounts/`{account}`/bank_accounts/`{id}`**
- **get,/v1/accounts/`{account}`/bank_accounts/`{id}`**
- **get,/v1/accounts/`{account}`/capabilities**
- **get,/v1/accounts/`{account}`/capabilities/`{capability}`**
- **post,/v1/accounts/`{account}`/capabilities/`{capability}`**
- **get,/v1/accounts/`{account}`/external_accounts**
- **post,/v1/accounts/`{account}`/external_accounts**
- **delete,/v1/accounts/`{account}`/external_accounts/`{id}`**
- **get,/v1/accounts/`{account}`/external_accounts/`{id}`**
- **get,/v1/accounts/`{account}`/external_accounts/`{id}`**
- **post,/v1/accounts/`{account}`/login_links**
- **get,/v1/accounts/`{account}`/people**
- **post,/v1/accounts/`{account}`/people**
- **delete,/v1/accounts/`{account}`/people/`{person}`**
- **get,/v1/accounts/`{account}`/people/`{person}`**
- **post,/v1/accounts/`{account}`/people/`{person}`**
- **get,/v1/accounts/`{account}`/persons**
- **post,/v1/accounts/`{account}`/persons**
- **delete,/v1/accounts/`{account}`/persons/`{person}`**
- **get,/v1/accounts/`{account}`/persons/`{person}`**
- **post,/v1/accounts/`{account}`/persons/`{person}`**
- **post,/v1/accounts/`{account}`/reject**
- **get,/v1/apple_pay/domains**
- **post,/v1/apple_pay/domains**
- **delete,/v1/apple_pay/domains/`{domain}`**
- **get,/v1/apple_pay/domains/`{domain}`**
- **get,/v1/application_fees**
- **get,/v1/application_fees/`{fee}`/refunds/`{id}`**
- **post,/v1/application_fees/`{fee}`/refunds/`{id}`**
- **get,/v1/application_fees/`{id}`**
- **post,/v1/application_fees/`{id}`/refund**
- **get,/v1/application_fees/`{id}`/refunds**
- **post,/v1/application_fees/`{id}`/refunds**
- **get,/v1/apps/secrets**
<!--
### delete,/v1/account
This operation can be used to delete the accounts that you manage in Stripe.
#### Required parameters:
- **account**: Enter the account id of account that you want to delete. example: `acct_1032D82eZvKYlo2C`
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Firestore](/img/datasource-reference/stripe/delete-account.png)
</div>
### get,/v1/account
This operation returns the basic account information such as account id, capabilities, currency, country etc.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Firestore](/img/datasource-reference/stripe/get-account.png)
</div>
### post,/v1/account
This operation updates the connected account by setting the values of the parameters passed. Any parameters not provided are left unchanged.
### post,/v1/account/bank_accounts
This operation will create a bank account in your stripe account.
### delete,/v1/account/bank_accounts/{id}
This operation can be used to delete a specified external account for a given account.. You'll need to provide the **id** of the bank account in stripe.
### get,/v1/account/bank_accounts/{id}
This operation can be used to retrieve a specified external account whose **id** is provided in parameters.
### post,/v1/account/bank_accounts/{id}
This operation can be used to update the metadata, account holder name, account holder type of a bank account belonging to a Custom Account, and optionally sets it as the default for its currency. Other bank account details are not editable by design. You can re-enable a disabled bank account by performing an update call without providing any arguments or changes.
### get,/v1/account/capabilities
This operation returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first.
### get,/v1/account/capabilities/{capability}
This operation retrieves information about the specified Account Capability.
### post,/v1/account/capabilities/{capability}
This operation updates an existing Account Capability.
### get,/v1/account/external_accounts
List external accounts for an account.
### post,/v1/account/external_accounts
This operation creates an external account for a given account.
### delete,/v1/account/external_accounts/{id}
This operation deletes a specified external account for a given account.
-->

View file

@ -1,54 +0,0 @@
---
id: twilio
title: Twilio
---
# Twilio
ToolJet can connect to your Twilio account to send sms.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Twilio](/img/datasource-reference/twilio/connect.png)
</div>
## Connection
- To add the Twilio datasource, click the **Datasource manager** icon on the left-sidebar of the app builder and click on the `Add datasource` button, then select **Twilio** from the modal that pops up.
- In the next dialog, you'll be asked to enter the Auth Token, Account SID, and Messaging Service SID.
- You can get the **Auth Token and Account SID** on the dashboard of your Twilio account.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Twilio](/img/datasource-reference/twilio/auth.png)
</div>
- For **Messaging Service SID**, you'll need to create a messaging service first from the Services under Messaging in the left-sidebar.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Twilio](/img/datasource-reference/twilio/sid.png)
</div>
- After entering the three credentials, you can **Save** the datasource.
## Supported operations
1. **Send message**
### Send message
This operation will send the specified message to specified mobile number.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Twilio](/img/datasource-reference/twilio/sms.png)
</div>

View file

@ -1,92 +0,0 @@
---
id: typesense
title: TypeSense
---
# TypeSense
ToolJet can connect to your TypeSense deployment to read and write data.
## Connection
Please make sure the host/IP of the TypeSense deployment is accessible from your VPC if you have self-hosted ToolJet. If you are using ToolJet cloud, please **whitelist our IP**.
ToolJet requires the following to connect to your TypeSense deployment:
- **Host**
- **Port**
- **API Key**
- **Protocol**
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/typesense/connect.png" alt="typesense connect" />
</div>
## Querying TypeSense
Click on `+` button of the query manager at the bottom panel of the editor and select the TypeSense added in the previous step as the data source.
Select the operation that you want to perform on your TypeSense cluster and click `Create` to save the query.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/datasource-reference/typesense/query.png" alt="typesense query" />
</div>
:::tip
Query results can be transformed using transformations. Read our transformations documentation to see how: **[link](/docs/tutorial/transformations)**
:::
## Supported operations
#### 1. Create a Collection
With this operation you can easily create `Collections` in your TypeSense cluster. In the schema field, you'll need to define the schema for creating a new collection. Check out TypeSense docs to know more about collections **[here](https://typesense.org/docs/0.22.2/api/collections.html#create-a-collection)**
<img className="screenshot-full" src="/img/datasource-reference/typesense/collection.png" alt="typesense collection" />
#### 2. Index a document
Use this operation to index a document to your collection. You'll need to specify the **Collection Name** where you want your document to be indexed and also provide the document data according the schema defined in the collection. Read more about Indexing a document in TypeSense **[here](
https://typesense.org/docs/0.22.2/api/documents.html#index-a-single-document)**.
<img className="screenshot-full" src="/img/datasource-reference/typesense/index.png" alt="typesense index" />
#### 3. Search
Use this operation to perform a search within the specified collection. Know more about the search parameters in the TypeSense doc **[here](https://typesense.org/docs/0.22.2/api/documents.html#search)**.
<img className="screenshot-full" src="/img/datasource-reference/typesense/search.png" alt="typesense search" />
#### 4. Get a document
Use this operation to fetch an individual document in a collection by providing the `id` of the document. Read more about it **[here](https://typesense.org/docs/0.22.2/api/documents.html#retrieve-a-document)**.
<img className="screenshot-full" src="/img/datasource-reference/typesense/get.png" alt="typesense get"/>
#### 5. Update a document
Use this operation to update an individual document by providing the **Collection Name** and **Id** of the document. You'll need to provide the updated document data in the form of specified schema. Check out the TypeSense's doc on updating a document **[here](https://typesense.org/docs/0.22.2/api/documents.html#update-a-document)**.
<img className="screenshot-full" src="/img/datasource-reference/typesense/update.png" alt="typesense update" />
#### 6. Delete a document
Delete a document from collection by providing the `Id` of the document. Check out the TypeSense's doc on deleting documents **[here](https://typesense.org/docs/0.22.2/api/documents.html#delete-documents)**.
<img className="screenshot-full" src="/img/datasource-reference/typesense/delete.png" alt="typesense delete" />
:::tip
Make sure that you supply JSON strings instead of JavaScript objects for any document or schema that is being passed to the server, in any of the above operations.
:::

View file

@ -1,64 +0,0 @@
---
id: woocommerce
title: WooCommerce
---
# WooCommerce
ToolJet can connect to WooCommerce databases to read and write data.
- [Connection](#connection)
- [Getting Started](#querying-woocommerce)
## Connection
Auth
You may use [HTTP Basic Auth] by providing the REST API Consumer Key as the username and the REST API Consumer Secret as the password.
- **Host**
- **Consumer key**
- **Consumer secret**
![ToolJet - Data Source - Woocommerce](/img/datasource-reference/woocommerce/woocomerce-auth.png)
:::info
NOTE: For generating keys visit admin dashboard of woocommerce , more info: https://woocommerce.github.io/woocommerce-rest-api-docs/?javascript#authentication
:::
## Querying Woocommerce
**Operations**
**Customer**
- list customer
- update customer
- delete customer
- batch update customer
- create customer
- retrieve customer
**PRODUCT**
- list product
- update product
- delete product
- batch update product
- create product
- retrieve product
**ORDER**
- list order
- update order
- delete order
- batch update order
- create order
- retrieve order
**Coupon**
- list coupon
- create coupon
:::info
NOTE: For more info visit https://woocommerce.github.io/woocommerce-rest-api-docs/?javascript.
:::

View file

@ -1,96 +0,0 @@
---
id: zendesk
title: Zendesk
---
# Zendesk
ToolJet can connect to Zendesk APIs to read and write data using OAuth 2.0, which helps us to limit an application's access to a user's account.
- [Connection](#connection)
- [Querying Zendesk](#querying-zendesk)
## Connection
ToolJet connects to your Zendesk app using :
- **Zendesk Sub-domain**
- **Client ID**
- **Client Secret**
## Authorization Scopes
You can create a Zendesk data source with one of either of the two permission scopes :
1. **Read Only**
2. **Read and Write**
:::info
You must first be a verified user to make Zendesk API requests. This is configured in the Admin Center interface in **Apps and integrations > APIs > Zendesk APIs.** For more information, see Security and Authentication in the [Zendesk Support API reference](https://developer.zendesk.com/api-reference/ticketing/introduction/#security-and-authentication) or [check out Zendesk's docs](https://support.zendesk.com/hc/en-us/articles/4408845965210).
:::
To connect Zendesk datasource to your ToolJet application, go to the data source manager on the left-sidebar and click on the `+` button. Select Zendesk from the list of available datasources, provide the credentials and click **Connect to Zendesk** and authenticate via OAuth. And click **Save** to save the datasource.
<div style={{textAlign: 'center'}}>
![ToolJet - Data source - Zendesk](/img/datasource-reference/zendesk/zendesk.gif)
</div>
## Querying Zendesk
1. **[List Tickets](/docs/data-sources/zendesk#list-tickets)**
2. **[List requested Tickets](/docs/data-sources/zendesk#list-requested-tickets)**
3. **[Show a Ticket](/docs/data-sources/zendesk#show-tickets)**
4. **[Update a Ticket](/docs/data-sources/zendesk#update-tickets)**
5. **[List Users](/docs/data-sources/zendesk#list-users)**
6. **[Get Profile](/docs/data-sources/zendesk#get-profile)**
7. **[Search query](/docs/data-sources/zendesk#search-query)**
### List Tickets
Lists all the tickets in your Zendesk account.
### List requested Tickets
Lists all the tickets requested by the user.
| Fields | description |
| ----------- | ----------- |
| User ID | The id of the user |
### Show Tickets
Gets a ticket's properties with the given ID, though not the ticket comments.
| Fields | description |
| ----------- | ----------- |
| Ticket ID | The id of the ticket |
### Update Tickets
Updates a ticket's properties with the given ID.
| Fields | description |
| ----------- | ----------- |
| Ticket ID | The id of the ticket |
| Body | The properties and values to update. Example: `{{({ "ticket": {"status": "solved"} })}}` |
### List Users
Lists all the users in your Zendesk account.
### Get Profile
Gets a user's profile with the given ID.
| Fields | description |
| ----------- | ----------- |
| User ID | The id of the user |
### Search Query
The Search Query uses Zendesk's Search API to return tickets, users, and organizations with defined filters.
Common filters include:
- `type:ticket`
- `type:user`
- `type:organization`
- `type:ticket organization:12345 status:open`
| Fields | description |
| ----------- | ----------- |
| Query | The search query |

View file

@ -1,5 +0,0 @@
{
"label": "How To",
"position": 8,
"collapsed": true
}

View file

@ -1,115 +0,0 @@
---
id: access-cellvalue-rowdata
title: Change text color in columns of the table
---
# Change text color in columns by accessing `cellValue` and `rowData` in the table
In this how-to guide, we will build an app that will use a sample RestAPI to display the data in the table, and then we will change the text color of the columns according to the condition.
- Let's start by creating a new application and then adding a table widget into the canvas.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/newapp.gif)
</div>
- Now go to the **Query Panel** at the bottom of the app editor and click on the `+` button.
- Choose **RestAPI** data source
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/restapi.png)
</div>
- Now we will use a sample RestAPI endpoint - I have used the API provided by **coinstats.app**, API-URL:
https://api.coinstats.app/public/v1/coins?skip=0&limit=100&currency=USD
- Choose `GET` method, enter the request URL (API URL in previous step), name the query - I have named it `crypto`, and then **Create** the query
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/apiendpoint.png)
</div>
- Now hit the **Run** button next to the query name to run the query.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/runquery.png)
</div>
- Once you run the query, you can check the data returned by the query in the **Inspector** on the left sidebar.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/inspectord.png)
</div>
- Now that we have got the data, we will display it on the table. To do this, click on the widget handle of the table to open its properties in the right sidebar.
- In the Table Data field, enter `{{queries.crypto.data.coins}}` - as you can see in the screenshot of the inspector the data is inside the `coins` array. You'll see the data in the Preview(green box) below the field.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/data.png)
</div>
- Let's add the columns that we want to display on the table. Go to the **Columns** section, Add columns, set their Names, and set **key** for each column. I have added 5 columns: **Rank**, **Name**, **Symbol**, **Price**, and **Market Cap**.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/columns.png)
</div>
- Once you've added the columns, you'll get the table like this:
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/table.png)
</div>
### Using cellValue to change column text color
Now that we have our data on the table, we will change the color of the text in the **Price** and **Market Cap** columns.
- Edit table properties, go to **Columns**, and click on the Price Column to open its properties.
- For **Price** column, we want to change color of those cells who have value which is greater than 1000 to red else to green if it is less than 1000. So to do this, we will set a condition in **Text Color** property of this column: `{{cellValue >= 1000 ? 'red' : 'green'}}`
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/price.png)
</div>
- Similarly, we will do for **Market Cap** column. We want to change the text color of those cells who have value which is greater than 60000000000 to red else to green if it is less than 60000000000. so the condition will be `{{cellValue >= 60000000000 ? 'red' : 'green'}}`
- Now the text color of cells in the columns will be updated.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/cellvalue.png)
</div>
:::info
You can also use Hex Color Code instead of mentioning color in plane text.
:::
### Using rowData to change column text color
- To change the color of the text using `rowData` variable it is required to mention the column name whose cell value we will be comparing in the condition. Let's take a look by changing the text color of **Symbol** column.
- We will add a condition to look in the row data and if the row has column called `name` which has value `Solana` then it should change the color to red else the color should be green.
- Edit the properties of the Symbol column, set the **Text Color** field value to `{{rowData.name === 'Solana' ? 'red' : 'green'}}`.
- You'll see that in the Symbols column all the values has become green except the one that has Solana in Name column.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Change text color in columns of the table](/img/how-to/change-text-color/rowData.png)
</div>

View file

@ -1,54 +0,0 @@
---
id: access-currentuser
title: Enable/Disable a component using current user's property
---
# Enable/Disable a component using current user's property
Let's take look at the exposed variables of the current user property:
- **email** : The value can accessed using `{{globals.currentUser.email}}`
- **firstName** : The value can accessed using `{{globals.currentUser.firstName}}`
- **lastName** : The value can accessed using `{{globals.currentUser.lastName}}`
- **lastName** : The value can accessed using `{{globals.currentUser.lastName}}`
- **groups** : By default, the admin will be in the two groups `all_users` and `admin`, and any user who is not admin will always be in the `all_users` group by default. Since the **groups** is an array youll have to provide the index ([0], [1], and so on) to return the group name. The value can be accessed using `{{globals.currentUser.groups[1]}}`.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-currentuser/props.png" alt="Properties of current user" />
</div>
### Example: Disable a button if a user is not admin
- Click on the **Button** handle to open its properties, on the **Styles** tab go to the **Disable** property.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-currentuser/button.png" alt="Properties of button" />
</div>
- Set a condition on the Disable field so that if the the user who is using the app does not have **admin** value in the first index of **groups** array return **true**. The condition can be:
```javascript
{{globals.currentUser.groups[1] !== "admin" ? true : false}}
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-currentuser/disable.png" alt="Disable Property of button" />
</div>
- Now, when you'll **release** the app, if the user is not is not admin the button will be disabled.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-currentuser/released.png" alt="Released button disabled when user is not admin" />
</div>
:::info
In this how-to we have used the **Groups** property of the **Current User**. You can use any of the exposed variables mentioned above according to your use.
:::

View file

@ -1,85 +0,0 @@
---
id: access-users-location
title: Access a user's location
---
# Access a user's location using RunJS query (Geolocation API)
In this how-to guide, we will build a ToolJet application that will utilize the **JavaScript Geolocation API** to get the user's location. The Geolocation API provides access to geographical location data associated with a user's device. This can be determined using GPS, WIFI, IP Geolocation and so on.
:::info
To protect the user's privacy, Geolocation API requests permission to locate the device. If the user grants permission, you will gain access to location data such as latitude, longitude, altitude, and speed.
:::
- Let's start by creating a new application
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-location/newapp.png" alt="New App" />
</div>
- In the app editor, go to the query panel at the bottom and create a **RunJS query** by selecting **Run JavaScript Code** as the datasource
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-location/runjs.png" alt="New App" />
</div>
- You can use the following javascript code that makes use of geolocation api to get the location
```js
function getCoordinates() {
return new Promise(function(resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject);
});
}
async function getAddress() {
// notice, no then(), cause await would block and
// wait for the resolved result
const position = await getCoordinates();
let latitude = position.coords.latitude;
let longitude = position.coords.longitude;
return [latitude, longitude];
}
return await getAddress()
```
- Now, go to the **Advanced** tab and enable the `Run query on page load?` option. Enabling this option will run this javascript query every time the app is opened by the user and the query will return the location
- **Save** the query and hit the fire button
- As soon as you hit the fire button, the browser will prompt you to allow the permission to share the location access to ToolJet app. You'll need to **allow** it to return the location data
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-location/prompt.png" alt="New App" />
</div>
- Now, to check the data returned by the query go to the **Inspector** on the left sidebar. Expand the queries -> `runjs1`(query name) -> and then expand the **data**. You'll find the coordinates
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-location/data.png" alt="New App" />
</div>
- Next, we can use these coordinates returned by the query on the **map component** to show the location. Drop a map component on the canvas and edit its properties. In the **Initial location** property, enter
```js
{{ {"lat": queries.runjs1.data[0], "lng": queries.runjs1.data[1]} }}
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/access-location/map.png" alt="New App" />
</div>
- Finally, you'll see the location updated on the **map component**

View file

@ -1,116 +0,0 @@
---
id: bulk-update-multiple-rows
title: Bulk update multiple rows in table
---
# Bulk update multiple rows in table
Currently, the datasources in ToolJet have operation for **bulk update(GUI mode)** but that only works for changes made in the single row. We will soon be adding a new operation for bulk updating the multiple rows but for now we can bulk update multiple rows by creating a Custom JS query.
In this guide, We have assumed that you have successfully connected the data source. For this guide, we will be using the PostgreSQL data source as an example database, currently, this workaround can be used only for PostgreSQL and MySQL.
## 1. Create a query to get the data from the database
Let's create the query that will be getting the data from the database:
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Bulk update multiple rows in table](/img/how-to/bulk-update-multiple/postgres1.png)
</div>
## 2. Display the data on the table
- Drag a **Table** widget on the canvas and click on its handle to open the properties on the left sidebar
- Edit the **Table data** field value and enter **`{{queries.postgresql1.data}}`**
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Bulk update multiple rows in table](/img/how-to/bulk-update-multiple/showData.png)
</div>
## 3. Make the columns editable
- Go to the **Columns**, Add or edit columns section and enter the **Column Name** that you want to display on the table and the **Key** name. Key is the name of the column in your database.
- Enable the toggle for **Make editable** for the columns that you want to be editable.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Bulk update multiple rows in table](/img/how-to/bulk-update-multiple/columns.png)
</div>
## 4. Enable bulk update options for table widget
- Go to the **Options** section and enable the **Show update buttons**. Enabling this will add two buttons - **Save Changes** and **Discard Changes** at the bottom of the table, only when any cell in the table is edited.
- You can also enable highlight selected row.(**Optional**)
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Bulk update multiple rows in table](/img/how-to/bulk-update-multiple/options.png)
</div>
## 5. Create a Custom JS query
We will create a new Custom JS query(**runjs1**) that will generate SQL query for updating multiple rows.
```js
const uniqueIdentifier = "id"
const cols = Object.values(components.table1.changeSet).map((col, index) => {
return {
col: Object.keys(col),
[uniqueIdentifier]: Object.values(components.table1.dataUpdates)[index][uniqueIdentifier],
values: Object.values(col),
};
});
const sql = cols.map((column) => {
const { col, id, values } = column;
const cols = col.map((col, index) => `${col} = '${values[index]}'`);
return `UPDATE users SET ${cols.join(", ")} WHERE id = '${id}';`;
});
return sql
```
:::info
Here the **Unique identifier** is **id**, this is the column name that is used to identify the row in the database.
Update the **Unique identifier** if you are using a different column name.
Update **table1** with the name of the table you are using.
:::
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Bulk update multiple rows in table](/img/how-to/bulk-update-multiple/runjs1.png)
</div>
## 6. Create an Update query
Let's create a new PostgreSQL query and name it `update`. In **SQL mode**, enter `{{queries.runjs1.data.join(' ')}}` and **Save** it.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Bulk update multiple rows in table](/img/how-to/bulk-update-multiple/update.png)
</div>
## 7. Creating a flow for queries
- Click on the handle of the **Table** widget to open its properties
- Go to the **Events**, and add a handler
- Select **Bulk Update** in Events, **Run Query** in Actions, and then select the **runjs1** query in Query. Now whenever a user will edit the table and hit the **Save Changes** button runjs1 will run.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Bulk update multiple rows in table](/img/how-to/bulk-update-multiple/event.png)
</div>
- Now, go to the **Advanced** tab of **runjs1** and add a handler to run update query for **Query Success** Event. Now whenever the runjs1 query will be run - the update operation will be performed on the database.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Bulk update multiple rows in table](/img/how-to/bulk-update-multiple/success.png)
</div>

View file

@ -1,23 +0,0 @@
---
id: intentionally-fail-js-query
title: Intentionally fail a RunJS query
---
In this how-to guide, we will create a RunJS query that will throw an error.
- Create a RunJS query and paste the code below. We will use the constructor `ReferenceError` since it is used to create a range error instance.
```js
throw new ReferenceError('This is a reference error.');
```
- Now, add a event handler to show an alert when the query fails. **Save** the query and **Run** it.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/failjs/failjs.gif" alt="Intentionally fail a RunJS query" />
</div>
:::info
Most common use-case for intentionally failing a query is **debugging**.
:::

View file

@ -1,66 +0,0 @@
---
id: oauth2-authorization
title: REST API authentication using OAuth 2.0
---
# REST API authentication using OAuth 2.0
ToolJets REST API data source supports OAuth 2.0 as the authentication type. In this guide, well learn how to use **Google OAuth2 API** to delegate authorization and authentication for your ToolJet Application.
Before setting up the REST API data source in ToolJet, we need to configure the **Google Cloud Platform** to gather the API keys required for the authorization access.
## Setting up Google Cloud Platform
Google Cloud Platform provides access to more than 350 APIs and Services that can allow us to access data from our Google account and its services. Let's create an OAuth application that can be given permission to use our Google profile data such as Name and Profile picture.
1. Sign in to your [Google Cloud](https://cloud.google.com/) account, and from the console create a New Project.
2. Navigate to the **APIs and Services**, and then open the **OAuth consent screen** section from the left sidebar.
3. Enter the Application details and select the appropriate scopes for your application. We will select the profile and the email scopes.
4. Once you have created the OAuth consent screen, Create new credentials for the **OAuth client ID** from the **Credentials** section in the left sidebar.
5. Select the application type, enter the application name, and then add the following URIs under Authorised Redirect URIs:
1. `https://app.tooljet.com/oauth2/authorize` (if youre using ToolJet cloud)
2. `http://localhost:8082/oauth2/authorize` (if youre using ToolJet locally)
6. Now save and then youll get the **Client ID and Client secret** for your application.
<img class="screenshot-full" src="/img/how-to/oauth2-authorization/gcp.png" alt="ToolJet - How To - REST API authentication using OAuth 2.0" height="420"/>
## Configuring ToolJet Application with Google's OAuth 2.0 API
Let's follow the steps to authorize ToolJet to access your Google profile data:
- Select **add data source** from the left sidebar, and choose **REST API** from the dialog window.
:::info
You can rename the data source by clicking on its default name `REST API`
:::
- In the **URL** field, enter the base URL `https://www.googleapis.com/oauth2/v1/userinfo`; the base URL specifies the network address of the API service.
- Select authentication type as `OAuth 2.0`
- Keep the default values for **Grant Type**, **Add Access Token To**, and **Header Prefix** i.e. `Authorization Code`, `Request Header`, and `Bearer` respectively.
- Enter **Access Token URL**: `https://oauth2.googleapis.com/token`; this token allows users to verify their identity, and in return, receive a unique access token.
- Enter the **Client ID** and **Client Secret** that we generated from the [Google Console](http://console.developers.google.com/).
- In the **Scope** field, enter `https://www.googleapis.com/auth/userinfo.profile`; Scope is a mechanism in OAuth 2.0 to limit an application's access to a user's account. Check the scopes available for [Google OAuth2 API here](https://developers.google.com/identity/protocols/oauth2/scopes#oauth2).
- Enter **Authorization URL:** `https://accounts.google.com/o/oauth2/v2/auth`; the Authorization URL requests authorization from the user and redirects to retrieve an authorization code from identity server.
- Create three **Custom Authentication Parameters:**
| params | description |
| ----------- | ----------- |
| response_type | code ( `code` refers to the Authorization Code) |
| client_id | **Client ID** |
| redirect_uri | `http://localhost:8082/oauth2/authorize` if using ToolJet locally or enter this `https://app.tooljet.com/oauth2/authorize` if using ToolJet Cloud. |
- Keep the default selection for **Client Authentication** and **Save** the data source.
<img class="screenshot-full" src="/img/how-to/oauth2-authorization/restapi.png" alt="ToolJet - How To - REST API authentication using OAuth 2.0"/>
## Create the query
Lets create a query to make a `GET` request to the URL, it will pop a new window and ask the user to authenticate against the API.
- Add a new query and select the REST API datasource from the dropdown
- In the **Method** dropdown select `GET` and in advance tab toggle `run query on page load?`
- **Save** and **Run** the query.
<img class="screenshot-full" src="/img/how-to/oauth2-authorization/oauth.gif" alt="ToolJet - How To - REST API authentication using OAuth 2.0"/>
A new window will pop for authentication and once auth is successful, you can run the query again to get the user data like Name and Profile Picture.

View file

@ -1,204 +0,0 @@
---
id: run-actions-from-runjs
title: Run Actions from RunJS query
---
# Run `Actions` from RunJS query
Now you can trigger all the `actions` available in ToolJet from within the `RunJS` query. This guide includes the syntax for each action along with the example.
### Run Query
**Syntax:**
```js
queries.queryName.run()
```
or
```js
await actions.runQuery('queryName')
```
**Example:** In the screenshot below, we are triggering the two different queries `customers` and `getData` using the two different syntax available for `Run Query` action.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/runquery.png)
</div>
### Set Variable
**Syntax:**
```javascript
actions.setVariable(variableName, variableValue)
```
**Example:** In the screenshot below, we are setting the two variables `test` and `test2`. `test` variable includes a numerical value so we haven't wrapped it inside the quotes but the variable `test2` is a string so we have wrapped it in quotes.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/setvariable.png)
</div>
### Unset Variable
**Syntax:**
```javascript
actions.unSetVariable(variableName)
```
**Example:** In the screenshot below, we are unsetting the variable `test2` that we created in the previous step.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/unsetvariable.png)
</div>
### Logout
**Syntax:**
```javascript
actions.logout()
```
**Example:** Triggering `actions.logout()` will log out the current logged in user from the ToolJet and will redirect to sign in page.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/logout.png)
</div>
### Show Modal
**Syntax:**
```javascript
actions.showModal('modalName')
```
**Example:** In the screenshot below, there is a modal on the canvas (renamed it to `formModal` from `modal1`) and we are using RunJS query to show the modal.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/showmodal.png)
</div>
### Close Modal
**Syntax:**
```javascript
actions.closeModal('modalName')
```
**Example:** In the screenshot below, we have used RunJS query to close the modal that we showed up in previous step.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/closemodal.png)
</div>
### Set Local Storage
**Syntax:**
```javascript
actions.setLocalStorage('key','value')
```
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/setlocalstorage.png)
</div>
### Copy to Clipboard
**Syntax:**
```javascript
actions.copyToClipboard('contentToCopy')
```
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/copytoclipboard.png)
</div>
### Generate File
**Syntax:**
```javascript
actions.generateFile('fileName', 'fileType', 'data')
```
**Example:** `fileName` is the name that you want to give the file(string), `fileType` can be `csv` or `text`, and `data` is the data that you want to store in the file.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/generatefile.png)
</div>
### Go to App
**Syntax:**
```javascript
actions.goToApp('slug',queryparams)
```
- `slug` can be found in URL of the released app after the `application/`, or in the `Share` modal
- `queryparams` can be provided like this `[ ['key1','value1' ], ['key2','value2'] ]`
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/gotoapp1.png)
</div>
### Show Alert
**Syntax:**
```javascript
actions.showAlert(alert type , message ) // alert types are info, success, warning, and danger
```
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Run Actions from RunJS query](/img/how-to/run-actions-from-runjs/showalert.png)
</div>
## Run multiple actions from runjs query
To run multiple actions from a runjs query, you'll have to use async-await in the function.
Here is an sample code for running the queries and showing alert after specific intervals. Check the complete guide on running queries at specified intervals **[here](/docs/next/how-to/run-query-at-specified-intervals)**.
```js
actions.setVariable('interval',setInterval(countdown, 5000));
async function countdown(){
await queries.restapi1.run()
await queries.restapi2.run()
await actions.showAlert('info','This is an information')
}
```

View file

@ -1,52 +0,0 @@
---
id: run-query-at-specified-intervals
title: Run query at specified intervals
---
In this how-to guide, we will learn how to make a query trigger at the specific intervals.
- Let's go to the ToolJet dashboard and **create a new application**
- Once the app builder opens up, drag a **table** component to canvas
- Now, create a new REST API query from the query panel at the bottom of the app builder. We will be using the data from the mock **REST API** and then load the data on the table. Let's create a REST API, choose `GET` method from the dropdown, enter the endpoint `(https://jsonplaceholder.typicode.com/posts)`, name the query `post` and then **save and run** it
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/setinterval/query.png" alt="REST API query" width="600" />
</div>
- Go to the **Table properties** and add connect the query data to table by adding value to **table data** property which is `{{queries.post.data}}`
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/setinterval/data.png" alt="REST API query" width="300" />
</div>
- Now, we will create a RunJS query that will first set a variable called `interval` which will include the value returned by the `setInterval()` method that calls a function `countdown` at specified intervals. The countdown function has the code to trigger the `post` query that we created in the previous step.
```js
actions.setVariable('interval',setInterval(countdown, 5000));
function countdown(){
queries.post.run()
}
```
- Or use **async**-**await** in the function, if you're triggering multiple actions:
```js
actions.setVariable('interval',setInterval(countdown, 5000));
async function countdown(){
await queries.restapi1.run()
await queries.restapi2.run()
await actions.showAlert('info','This is an information')
}
```
- Go to the **Advanced** tab of the query, enable `Run query on page load?` this will trigger this RunJS query when the app is loaded. Name the query as `set` and **Save** it. Note that you will have to save the query and not `Save and Run` because doing it will trigger the query and you won't be able to stop the query unless you reload the page or go back to dashboard.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/setinterval/set.png" alt="REST API query" width="700" />
</div>
- To prevent the query from triggering indefinitely, we will create another RunJS query that will make use of `clearInterval()` method. In this method we will get the value from the variable that we created in `set` query. Save this query as `clear`.
```js
clearInterval(variables.interval)
```
- Finally, let's add a **button** on to the canvas and add the **event handler** to the button to run the `clear` query.
- Now, whenever the app will be loaded the **set** query will be triggered and will keep triggering the `post` query at the specified intervals. Whenever the user wants to **stop** the query they can click on the **button** to trigger the **clear** query which will clear the interval.

View file

@ -1,137 +0,0 @@
---
id: upload-files-aws
title: Upload files on AWS S3 bucket
---
# Upload and download files on AWS S3 bucket
This guide will help you in quickly building a basic UI for uploading or downloading files from AWS S3 buckets.
Before building the UI, check out the **[docs for AWS S3 data source](/docs/data-sources/s3)** to learn about setting up AWS S3 and adding the data source.
Once you have successfully added the AWS data source, build a basic UI using the following widgets:
- **Dropdown**: For selecting a bucket in S3 storage.
- **Table**: For listing all the objects inside the selected bucket in dropdown.
- **Text Input**: For getting a path for the file that is to be uploaded.
- **File picker**: For uploading the file.
- **Button**: This will be used to fire the upload query.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files on AWS S3 bucket](/img/how-to/upload-files-aws/ui.png)
</div>
## Queries
We'll create the following queries:
1. **getBuckets**
2. **listObjects**
3. **uploadToS3**
4. **download**
### getBuckets
This query will fetch the list of all the buckets in your S3. Just create a new query, select AWS S3 data source, and choose **List buckets** operation. Name the query **getBuckets** and click **Save**.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files on AWS S3 bucket](/img/how-to/upload-files-aws/getBuckets.png)
</div>
Now, let's edit the properties of **dropdown** widget.
- **Label**: Set the label as Bucket.
- **Option values**: Set option values as `{{queries.getBuckets.data.Buckets.map(bucket => bucket['Name'])}}`. We're mapping the data returned by the query as the returned data is array of abjects.
- **Option label**: Set option values as `{{queries.getBuckets.data.Buckets.map(bucket => bucket['Name'])}}`. This will display the same option label as option values.
You can later add an event handler for running the **listObject** query whenever an option is selected from the dropdown.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files on AWS S3 bucket](/img/how-to/upload-files-aws/dropdown.png)
</div>
### listObjects
This query will list all the objects inside the selected Bucket in dropdown. Select **List objects in a bucket** operation, enter `{{components.dropdown1.value}}` in the Bucket field - this will dynamically get the field value from the selected option in dropdown.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files on AWS S3 bucket](/img/how-to/upload-files-aws/listObjects.png)
</div>
Edit the properties of **table** widget:
- **Table data**: `{{queries.listObjects.data['Contents']}}`
- **Add Columns**:
- **Key**: Set the **Column Name** to `Key` and **Key** to `Key`
- **Last Modified**: Set the **Column Name** to `Last Modified` and **Key** to `LastModified`
- **Size**: Set the **Column Name** to `Size` and **Key** to `Size`
- Add a **Action button**: Set button text to **Copy signed URL**, Add a handler to this button for On Click event and Action to Copy to clipboard, in the text field enter `{{queries.download.data.url}}` - this will get the download url from the **download** query that we will create next.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files on AWS S3 bucket](/img/how-to/upload-files-aws/table.png)
</div>
### download
Create a new query and select **Signed URL for download** operation. In the Bucket field, enter `{{components.dropdown1.value}}` and in Key enter `{{components.table1.selectedRow.Key}}`.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files on AWS S3 bucket](/img/how-to/upload-files-aws/download.png)
</div>
Edit the **properties** of the table, add a Event handler for running the `download` query for `Row clicked` event. This will generate a signed url for download every time a row is clicked on the table.
### uploadToS3
Create a new query, select the **Upload object** operation. Enter the following values in their respective fields:
- **Bucket**: `{{components.dropdown1.value}}`
- **Key**: `{{ components.textinput1.value + '/' +components.filepicker1.file[0].name}}`
- **Content type**: `{{components.filepicker1.file[0].type}}`
- **Upload data**: `{{components.filepicker1.file[0].base64Data}}`
- **Encoding**: `base64`
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files on AWS S3 bucket](/img/how-to/upload-files-aws/uploadToS3.png)
</div>
#### Configure the file picker:
Click on the widget handle to edit the file picker properties:
- Change the **Accept file types** to `{{"application/pdf"}}` for the picker to accept only pdf files or `{{"image/*"}}` for the picker to accept only image files . In the screenshot below, we have set the accepted file type property to `{{"application/pdf"}}` so it will allow to select only pdf files:
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files using GCS](/img/how-to/upload-files-gcs/result-filepicker.png)
</div>
- Change the **Max file count** to `{{1}}` as we are only going to upload 1 file at a time.
- Select a pdf file and hold it in the file picker.
:::info
File types must be valid **[MIME](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types)** type according to input element specification or a valid file extension.
To accept any/all file type(s), set `Accept file types` to an empty value.
:::
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files using GCS](/img/how-to/upload-files-gcs/config-filepicker.png)
</div>
Final steps, go to the **Advanced** tab of the **uploadToS3** query and add a query to run **listObjects** query so that whenever a file is uploaded the tabled is refreshed.

View file

@ -1,73 +0,0 @@
---
id: upload-files-gcs
title: Upload files using GCS
---
# Upload files using GCS
In this guide, we are going to create an interface to upload PDFs to Google Cloud Storage.
Before adding the new data source we will need to have a private key for our GCS bucket and make sure the key has the appropriate rights.
## Setting up Google Cloud Storage data source
1. Go to the data source manager on the left-sidebar and click on the `+` button.
2. Add a new GCS data source from the **APIs** section in modal that pops up.
3. Enter the **JSON private key for service account** and test the connection.
4. Click on **Save** to add the data source.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files using GCS](/img/how-to/upload-files-gcs/adding-account.png)
</div>
## Adding a file picker
1. Drag and drop the **file picker** widget on the canvas
2. Configure the file picker:
- Change the **Accept file types** to `{{"application/pdf"}}` for the picker to accept only pdf files. In the screenshot below, we have set the accepted file type property to `{{"application/pdf"}}` so it will allow to select only pdf files:
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files using GCS](/img/how-to/upload-files-gcs/result-filepicker.png)
</div>
- Change the **Max file count** to `{{1}}` as we are only going to upload 1 file at a time.
3. Select a pdf file and hold it in the file picker.
:::info
File types must be valid **[MIME](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types)** type according to input element specification or a valid file extension.
To accept any/all file type(s), set `Accept file types` to an empty value.
:::
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files using GCS](/img/how-to/upload-files-gcs/config-filepicker.png)
</div>
## Creating a query
1. Click on the `+` button of the query manager at the bottom panel of the editor and select the GCS data source
2. Select **Upload file** operation and enter the required parameters:
- Bucket: `gs://test-1`
- File Name: `{{components.file1.file[0]['name']}}`
- Content Type: `{{components.file1.file[0]['type']}}`
- Upload data: `{{components.file1.file[0]['base64Data']}}`
- Encoding: `base64`
3. Click on **Save** to create the query
## Running the query
1. Add a **button** that will fire the query to upload the file
2. Edit the properties of the button and add a **event handler** to **Run the query** on **On-Click** event.
3. Click on **Button** to fire the query, this will upload the pdf file that you selected earlier through the file picker and will upload it on the GCS.
<div style={{textAlign: 'center'}}>
![ToolJet - How To - Upload files using GCS](/img/how-to/upload-files-gcs/final-result.png)
</div>

View file

@ -1,173 +0,0 @@
---
id: use-s3-signed-url-to-upload-docs
title: Use S3 signed URL to upload documents
---
# Use S3 signed URL to upload documents
In this how-to guide, you'll learn to upload documents to S3 buckets using the **S3 signed URL** from a ToolJet application.
For this guide, We are going to use one of the existing templates on ToolJet: **S3 File explorer**
:::info using Templates
On ToolJet Dashboard, Click on the down arrow on the right of the **New App** button, from the dropdown choose the **Choose from template** option.
:::
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/template.png" alt="Use S3 pre-signed URL to upload documents: Choose template" width="700"/>
</div>
- Once you've created a new app using the template, you'll be prompted to create a **new version** of the existing version. After creating a new version, you'll be able to make changes in the app.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/newversion.png" alt="Use S3 pre-signed URL to upload documents: new version"/>
</div>
- Go to the **datasource manager** on the left-sidebar, you'll find that the **AWS S3 datasource** is already added. All you need to do is update the datasource **credentials**.
:::tip
Check the [AWS S3 datasource reference](/docs/data-sources/s3) to learn more about connnection and choosing your preferred authentication method.
:::
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/s3connect.png" alt="Use S3 pre-signed URL to upload documents: add datasource"/>
</div>
- Once the datasource is connected successfully, go to the query manager and **Run** the **getBuckets** query. The operation selected in the getBuckets query is **List Buckets** which will fetch an array of all the buckets.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/getbuckets.png" alt="Use S3 pre-signed URL to upload documents: getBuckets query"/>
</div>
- Running the **getBuckets** query will load all the buckets in the dropdown in the app.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/dropdown.png" alt="Use S3 pre-signed URL to upload documents: loading buckets"/>
</div>
- Select a **bucket** from the dropdown and click on the **Fetch files** button to list all the files from the selected bucket on the table. The **Fetch files** button has the event handler added that triggers the **s32** query, the **s32** query uses the **List objects in a bucket** operation, and the bucket field in the query gets the value dynamically from the dropdown.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/fetchfiles.png" alt="Use S3 pre-signed URL to upload documents: list objects in a bucket"/>
</div>
- Let's go to the **uploadToS3** query and update the field values:
- **Operation**: Signed URL for upload
- **Bucket**: `{{components.dropdown1.value}}` this will fetch the dynamic value from the dropdown
- **Key**: `{{components.filepicker1.file[0].name}}` this will get the file name from the filepickers exposed variables
- **Expires in:** This sets an expiration time of URL, by default its `3600` seconds (1 hour)
- **Content Type**: `{{components.filepicker1.file[0].type}}` this will get the file type from the filepickers exposed variables
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/upload.png" alt="Use S3 pre-signed URL to upload documents"/>
</div>
- Create two **RunJS** queries:
- Create a **runjs1** query and copy-paste the code below. This query gets the **base64data** from the file picker and convert the file's `base64Data` to into `BLOB`, and returns the file object.
```js
const base64String = components.filepicker1.file[0].base64Data
const decodedArray = new Uint8Array(atob(base64String).split('').map(c => c.charCodeAt(0)));
const file = new Blob([decodedArray], { type: components.filepicker1.file[0].type });
const fileName = components.filepicker1.file[0].name;
const fileObj = new File([file], fileName);
return fileObj
```
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/runjs1.png" alt="Use S3 pre-signed URL to upload documents"/>
</div>
- Create another **runjs2** query and copy-paste the code below. This query gets the data(file object) returned by the first runjs query, the url returned by the **uploadToS3** query, and then makes PUT request.
```js
const file = queries.runjs2.data
const url = queries.s31.data.url
fetch(url, {
method: 'PUT',
body: file,
mode: 'cors',
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json'
}
})
.then(response => console.log('Upload successful!'))
.catch(error => console.error('Error uploading file:', error));
```
:::warning Enable Cross Origin Resource Sharing(CORS)
- For the file to be uploaded successfully, you will need to add the CORS policies from the **Permissions** tab of your **Bucket** settings. Here's a sample CORS:
```json
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"PUT",
"POST"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
```
:::
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/runjs2.png" alt="Use S3 pre-signed URL to upload documents"/>
</div>
- Go to the **uploadToS3**, scroll down and add an event handler to the **uploadToS3** query. Select the **Query Success** event, **Run Query** as the action, and **runjs1** as the query to be triggered. **Save** the query.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/eventhandlerupload.png" alt="Use S3 pre-signed URL to upload documents"/>
</div>
- Let's go to the **runjs1** query and add the event handler to run a query on query success event, similar to how we did in the previous step. In the event handler, choose **runjs2** query. **Save** the query.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/eventhandlerrunjs2.png" alt="Use S3 pre-signed URL to upload documents"/>
</div>
- Now, let's go the final query **copySignedURL** that is connected to the table's action button. This query copy's the generated **Signed URL for download** onto the **clipboard**.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/copysigned.png" alt="Use S3 pre-signed URL to upload documents"/>
</div>
- Now that we have updated all the queries, and connected them through the event handlers. We can go ahead and pick a file from the file picker. Click on the file picker, select a file and then hit the **Upload file to S3** button.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/how-to/uses3presignedurl/uploadbutton.png" alt="Use S3 pre-signed URL to upload documents"/>
</div>
- Once the button is clicked, the **uploadToS3** will triggered along with the **runjs1** and **runjs2** queries in sequence since we added them in the event handlers.
- You can go to the table and click on the **Copy signed URL** action button on the table, this will trigger the **copySignedURL** query and will copy the URL on the clipboard. You can go to another tab and paste the URL to open the file on the browser.

View file

@ -1,53 +0,0 @@
---
id: introduction
title: Introduction
description: ToolJet is an **open-source low-code framework** to build and deploy custom internal tools. ToolJet can connect to your data sources such as databases ( PostgreSQL, MongoDB, MS SQL Server, Snowflake, , BigQuery, etc ), API/GraphQL endpoints, SaaS tools ( Airtable, Stripe, Google Sheets, etc ) and cloud object storage services ( AWS S3, Google Cloud Storage and Minio ). Once the data sources are connected, ToolJet can run queries on these data sources to fetch and update data. The data fetched from data sources can be visualised and modified using the UI widgets such as tables, charts, forms, etc.
slug: /
---
# Introduction
ToolJet is an **open-source low-code framework** to build and deploy custom internal tools. ToolJet can connect to your data sources such as databases ( PostgreSQL, MongoDB, MS SQL Server, Snowflake, , BigQuery, etc ), API/GraphQL endpoints, SaaS tools ( Airtable, Stripe, Google Sheets, etc ) and cloud object storage services ( AWS S3, Google Cloud Storage and Minio ). Once the data sources are connected, ToolJet can run queries on these data sources to fetch and update data. The data fetched from data sources can be visualised and modified using the UI widgets such as tables, charts, forms, etc.
<img className="screenshot-full" src="/img/introduction/githubstar.png" alt="github star"/>
## How ToolJet works
<div style={{textAlign: 'center'}}>
![ToolJet - List view widget](/img/introduction/how-it-works.png)
</div>
**ToolJet has just 3 fundamental principles for building apps:**
- **Connect to data sources:** Connect to your existing data sources such as PostgreSQL, MySQL, Firestore, Stripe, Google Sheets, API endpoints, etc.
- **Build queries:** ToolJet comes with query builders for all supported data sources. ToolJet also supports the use of custom JavaScript code to transform the query results.
- **Customise widgets:** Widgets are the UI components that can be edited using ToolJet's visual app builder ( Eg: tables, charts, forms, etc ). Widgets have events such as `on click`, `on row selected`, `on page changed`, etc. Every UI widget has a dark version.
ToolJet binds together the data sources, queries and widgets to convert business logic into custom applications.
## Getting Started
These resources will help you quickly build and deploy apps using ToolJet:
- **[Basic Tutorial](/docs/tutorial/creating-app)** - Learn how to build simple UI and connect to data sources.
- **[Deploy](/docs/setup/)** - Learn how to deploy ToolJet on Heroku, Kubernetes, etc
The references for data sources and widgets:
- **[Datasource Reference](/docs/data-sources/redis)**
- **[Widget Reference](/docs/widgets/table)**
## Complete tutorials
- **[Build a GitHub star history tracker](https://blog.tooljet.com/build-github-stars-history-app-in-5-minutes-using-low-code/)**
- **[Build an AWS S3 file explorer app](https://blog.tooljet.com/building-an-app-to-view-and-upload-files-in-aws-s3-bucket/)**
- **[Build a WhatsApp CRM](https://blog.tooljet.com/build-a-whatsapp-crm-using-tooljet-within-10-mins/)**
- **[Build a cryptocurrency dashboard](https://blog.tooljet.com/how-to-build-a-cryptocurrency-dashboard-in-10-minutes/)**
- **[Build a Redis GUI](https://blog.tooljet.com/building-a-redis-gui-using-tooljet-in-5-minutes/)**
- **[Build a coupon code manager app](https://blog.tooljet.com/build-a-coupon-code-manager-app-in-10-minutes/)**
## Help and Support
- We have extensively documented the features of ToolJet, but in case you are stuck, please feel free to e-mail us at **hello@tooljet.com**
- If you are using ToolJet cloud, click on the chat icon at the bottom-left corner for instant help.
- If you have found a bug, please create a **[GitHub issue](https://github.com/ToolJet/ToolJet/issues)** for the same.
- Feel free to join our highly active **[Slack Community](https://tooljet.com/slack)**.

View file

@ -1,120 +0,0 @@
---
id: marketplace
title: Marketplace
---
# ToolJet Marketplace
ToolJet marketplace for plugins will allow users to install the custom plugins (datasources) for their ToolJet instances. This will allow ToolJet users to build their own custom plugins according to their requirements and then easily connect them to ToolJet.
## Enabling the marketplace for your instance
Users must add the following environment variable to the [`.env`](/docs/setup/env-vars#marketplace-feature-enable--optional-) file to enable the marketplace feature:
```bash
ENABLE_MARKETPLACE_FEATURE=true
```
Once the marketplace feature is enabled, users can open the **Marketplace** page from the dropdown on the navbar of the dashboard. Users can also directly access the marketplace using the URL: `https://tooljet.yourcompany.com/integrations`
:::info
The user logged-in should be the **Administrator** to access the marketplace page.
:::
## Installing a plugin
When you [create a plugin](#creating-a-marketplace-plugin) using the [tooljet cli](https://www.npmjs.com/package/@tooljet/cli), an object is created in the **plugins.json** (`ToolJet/server/src/assets/marketplace/plugins.json`) file for that particular plugin.
Here's an example of an entry created for AWS S3 plugin:
```json
[
{
"name": "AWS S3 plugin",
"description": "Datasource plugin for AWS S3",
"version": "1.0.0",
"id": "s3",
"repo": "",
"author": "Tooljet",
"timestamp": "Mon, 31 Oct 2022 11:02:10 GMT"
}
]
```
Now to install the plugin to the marketplace, you'll have to install npm package to a plugin:
```bash
npm i <npm-package-name> --workspace=<plugin-name-in-package-json>
```
Finally, run the build commands:
```bash
npm install
npm run build --workspaces
```
Once done, you'll find the plugin on the marketplace page.
## Removing a plugin
To remove a plugin from the marketplace, you can simply remove the object entry of the plugin from the **plugins.json**(`ToolJet/server/src/assets/marketplace/plugins.json`) and then re-run the build commands.
## Using a plugin as datasource
The flow for installing and using a plugin as a datasource is really simple. The steps are:
- Go to the **Marketplace**
- Click the Marketplace link in the left sidebar to view all available plugins.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/marketplace/marketplacemain.png" alt="Marketplace" />
</div>
- Click on the **Install** button of the plugin that you want to install
- Once installed, you can check the installed plugins from **Installed** on the left sidebar. You can also **remove** the plugins from the Installed section of the marketplace.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/marketplace/installed.png" alt="Installed plugins" />
</div>
- Now, let's use the installed plugin as the datasource for an application. User will have to open the application, go to the **Add Datasource** button on the left sidebar of the app builder, and then select Plugins on the modal that pops-up. The Plugins section will include all the plugins installed via Marketplace. The next steps are same as connecting a datasource to the application.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/marketplace/datasource.png" alt="Installed plugins as datasource" />
</div>
## Creating a marketplace plugin
The steps for creating a Marketplace plugin are similar to those for creating [plugins for ToolJet](/docs/1.x.x/contributing-guide/tutorials/creating-a-plugin/) except that for a Marketplace plugin, the user will have to type `yes` when prompted `Is it a marketplace integration?` in the `tooljet command line`.
The steps to create a marketplace plugin are:
- Install [tooljet-cli](https://www.npmjs.com/package/@tooljet/cli):
```bash
npm i -g @tooljet/cli
```
- Bootstrap a new plugin using cli
```bash
tooljet plugin create bigquery
```
- On the CLI, you'll be prompted to enter a display name:
```bash
Enter plugin display name:
```
- In the next step, you'll be asked to choose a plugin type **database**, **api**, or **cloud-storage**
- Now choose if `Is it a marketplace integration?` by entering `y/N`
- Enter the repository URL if the plugin is hosted on GitHub or else just press enter to skip to the next step
- Once done, all the plugin files will be generated inside the marketplace directory
```bash
creating plugin... done
Plugin: bigquery created successfully
└─ marketplace
└─ plugin
└─ bigquery
```
:::info
For more information on **[creating plugin for ToolJet](/docs/contributing-guide/tutorials/creating-a-plugin)**, please see the documentation on creating plugins.
:::

View file

@ -1,27 +0,0 @@
---
id: security
title: Security
slug: /security
---
# Security
## Uncompromised Data Security with SOC 2 Compliance
With SOC 2 compliance, Tooljet ensures the highest level of data security. The adherence to SOC 2 standards mirrors the rigorous data protection measures in place, covering everything from encryption to robust access controls. It also guarantees a consistent level of service availability and process integrity, instilling confidence in our customers and stakeholders about the safe handling of their sensitive information.
## Data storage
ToolJet does not store data returned from your data sources. ToolJet server acts as a proxy and passes the data as it is to the ToolJet client. The credentials for the data sources are handled by the server and never exposed to the client. For example, if you are making an API request, the query is run from the server and not from the frontend.
## Datasource credentials
All the datasource credentials are securely encrypted using `aes-256-gcm`. The credentials are never exposed to the frontend ( ToolJet client ).
## Other security features
- **TLS**: If you are using ToolJet cloud, all connections are encrypted using TLS. We also have documentation for setting up TLS for self-hosted installations of ToolJet.
- **Audit logs**: Audit logs are available on the enterprise edition of ToolJet. Every user action is logged along with the IP addresses and user information.
- **Request logging**: All the requests to server are logged. If self-hosted, you can easily extend ToolJet to use your preferred logging service. ToolJet comes with built-in Sentry integration.
- **Whitelisted IPs**: If you are using ToolJet cloud, you can whitelist our IP address (34.86.81.252) so that your datasources are not exposed to the public.
- **Backups**: ToolJet cloud is hosted on AWS using EKS with autoscaling and regular backups.
If you notice a security vulnerability, please let the team know by sending an email to `security@tooljet.com`.

View file

@ -1,5 +0,0 @@
{
"label": "Setup",
"position": 2,
"collapsed": true
}

View file

@ -1,83 +0,0 @@
---
id: azure-container
title: Azure container apps
---
# Deploying ToolJet on Azure container apps
:::info
Please note that you need to set up a PostgreSQL database manually to be used by ToolJet
:::
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*
## Deploying ToolJet application
1. Open the Azure dashboard at https://portal.azure.com, navigate to Container Apps, and click on "Create container app".
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/setup/azure-container/step1.png" alt="Deploying ToolJet on Azure container apps" />
</div>
2. Select the appropriate subscription and provide basic details such as the container name.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/setup/azure-container/step2.png" alt="Deploying ToolJet on Azure container apps" />
</div>
3. In the container tab, uncheck the "Use quickstart image" option to select the image source manually.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/setup/azure-container/step3-v2.png" alt="Deploying ToolJet on Azure container apps" />
</div>
- Make sure to provide the image tag, and then enter `npm run start:prod` in the "Command override" field.
- Add the following ToolJet application variables under the "Environmental variable" section. You can refer to this [**documentation**](/docs/setup/env-vars) for more information on environment variables.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/setup/azure-container/step4-v2.png" alt="Deploying ToolJet on Azure container apps" />
</div>
4. In the ingress tab, configure Ingress and Authentication settings as shown below. You can customize the security configurations as per your requirements. Make sure the port is set to 3000.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/setup/azure-container/step4.png" alt="Deploying ToolJet on Azure container apps" />
</div>
5. Click on "Review + create" and wait for the template to be verified and passed, as shown in the screenshot below.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/setup/azure-container/step5.png" alt="Deploying ToolJet on Azure container apps" />
</div>
6. Once the container is deployed, you can verify its status under revision management.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/setup/azure-container/step6.png" alt="Deploying ToolJet on Azure container apps" />
</div>
You can access ToolJet via the application URL provided in the overview tab.
## Upgrading to the Latest Version
The latest version includes architectural changes and, hence, comes with new migrations.
If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.
#### Prerequisites for Upgrading to the Latest Version:
- It is **crucial to perform a comprehensive backup of your database** before starting the upgrade process to prevent data loss.
- Ensure that your current version is v2.23.0-ee2.10.2 before upgrading.
- Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the latest version.
For specific issues or questions, refer to our **[Slack](https://tooljet.slack.com/join/shared_invite/zt-25438diev-mJ6LIZpJevG0LXCEcL0NhQ#)**.

View file

@ -1,114 +0,0 @@
---
id: client
title: Deploying ToolJet client
---
# Deploying ToolJet client
ToolJet client is a standalone application and can be deployed on static website hosting services such as Netlify, Firebase, S3/Cloudfront, etc.
You can build standalone client with the below command:
```bash
SERVE_CLIENT=false npm run build
```
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*
## Deploying ToolJet client on Firebase
:::tip
You should set the environment variable `TOOLJET_SERVER_URL` ( URL of the server ) while building the frontend and also set `SERVE_CLIENT` to `false`` for standalone client build.
For example: `SERVE_CLIENT=false TOOLJET_SERVER_URL=https://server.tooljet.com npm run build && firebase deploy`
:::
1. Initialize firebase project
```bash
firebase init
```
Select Firebase Hosting and set build as the static file directory
2. Deploy client to Firebase
```bash
firebase deploy
```
## Deploying ToolJet client with Google Cloud Storage
:::tip
You should set the environment variable `TOOLJET_SERVER_URL` ( URL of the server ) while building the frontend.
For example: `SERVE_CLIENT=false TOOLJET_SERVER_URL=https://server.tooljet.io npm run build`
:::
#### Using Load balancer
Tooljet client can be hosted from Cloud Storage bucket just like hosting any other static website.
Follow the instructions from google documentation [here](https://cloud.google.com/storage/docs/hosting-static-website).
Summarising the steps below:
1. Create a bucket and upload files within the build folder such that the `index.html` is at the bucket root.
2. Edit permissions for the bucket to assign *New principal* as `allUsers` with role as `Storage Object Viewer` and permit for public access for the bucket.
3. Click on *Edit website configuration* from the [buckets browser](https://console.cloud.google.com/storage/browser?_ga=2.180838119.1530169400.1637242882-657891227.1637242882) and specify the main page as `index.html`
4. Follow the [instructions](https://cloud.google.com/storage/docs/hosting-static-website#lb-ssl) on creating a load balancer for hosting a static website.
5. Optionally, create Cloud CDN to use with the backend bucket assigned to the load balancer.
6. After the load balancer is created there will be an IP assigned to it. Try hitting it to check the website is being loaded.
7. Use the load balancer IP as the static IP for the A record of your domain.
#### Using Google App Engine
1. Upload the build folder onto a bucket
2. Upload `app.yaml` file onto bucket with the following config
```yaml
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: build/index.html
upload: build/index.html
- url: /(.*)
static_files: build/\1
upload: build/(.*)
```
3. Activate cloud shell on your browser and create build folder
```bash
mkdir tooljet-assets
```
4. Copy the uploaded files onto an assets folder which is to be served
```bash
gsutil rsync -r gs://your-bucket-name/path-to-assets ./tooljet-assets
```
5. Deploy static assets to be served
```bash
cd tooljet-assets && gcloud app deploy
```
## Upgrading to the Latest Version
The latest version includes architectural changes and, hence, comes with new migrations.
If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.
#### Prerequisites for Upgrading to the Latest Version:
- It is **crucial to perform a comprehensive backup of your database** before starting the upgrade process to prevent data loss.
- Ensure that your current version is v2.23.0-ee2.10.2 before upgrading.
- Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the latest version.
For specific issues or questions, refer to our **[Slack](https://tooljet.slack.com/join/shared_invite/zt-25438diev-mJ6LIZpJevG0LXCEcL0NhQ#)**.

View file

@ -1,61 +0,0 @@
---
id: digitalocean
title: DigitalOcean
---
# Deploying ToolJet on DigitalOcean
Now you can quickly deploy ToolJet using the Deploy to DigitalOcean button.
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*
## Deploying
#### Follow the steps below to deploy ToolJet on DigitalOcean:
1. Click on the button below to start one click deployment
<div style={{textAlign: 'center'}}>
[![Deploy to DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/ToolJet/ToolJet/tree/main)
</div>
2. A new tab will open up, sign-in to your DigitalOCean account. Once signed-in, the **Create App** page will open up and **Resources** will be already selected. Click on **Next** button.
<img className="screenshot-full" src="/img/setup/digitalocean/resources.png" alt="ToolJet - Deploy on DigitalOcean - Resources" />
3. Now, on **Environment Variables** page you can add new variables or edit the existing ones. Check the [environment variables here](/docs/setup/env-vars).
<img className="screenshot-full" src="/img/setup/digitalocean/env.png" alt="ToolJet - Deploy on DigitalOcean - Environment Variables" />
4. On the next page, you can change the **App name**, **Project**, and the **Region**.
<img className="screenshot-full" src="/img/setup/digitalocean/region.png" alt="ToolJet - Deploy on DigitalOcean - App name" />
5. On the last page, you'll be asked to **Review** all the app details such that we entered before such as **Resources**, **Environment Variables**, **Region**, and there will also be **Billing** section at the end. Review all the details and click the **Create Resource** button.
<img className="screenshot-full" src="/img/setup/digitalocean/review.png" alt="ToolJet - Deploy on DigitalOcean - App name" />
6. Once you click the **Create Resource** button, the build will begin. Once the build is complete, you'll see the resource and a **URL** next to it. Click on the URL to open the deployed **ToolJet**.
:::tip
ToolJet server and client can be deployed as standalone applications. If you do not want to deploy the client on DigitalOcean, modify `package.json` accordingly. We have a [guide](/docs/setup/client) on deploying ToolJet client using services such as Firebase.
:::
## Upgrading to the Latest Version
The latest version includes architectural changes and, hence, comes with new migrations.
If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.
#### Prerequisites for Upgrading to the Latest Version:
- It is **crucial to perform a comprehensive backup of your database** before starting the upgrade process to prevent data loss.
- Ensure that your current version is v2.23.0-ee2.10.2 before upgrading.
- Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the latest version.
For specific issues or questions, refer to our **[Slack](https://tooljet.slack.com/join/shared_invite/zt-25438diev-mJ6LIZpJevG0LXCEcL0NhQ#)**.

View file

@ -1,153 +0,0 @@
---
id: docker
title: Docker
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Deploying ToolJet using Docker Compose
Follow the steps below to deploy ToolJet on a server using Docker Compose. ToolJet requires a PostgreSQL database to store applications definitions, (encrypted) credentials for datasources and user authentication data.
:::info
If you rather want to try out ToolJet on your local machine with Docker, you can follow the steps [here](/docs/1.x.x/setup/try-tooljet).
:::
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*
### Installing Docker and Docker Compose
Install docker and docker-compose on the server.
- Docs for [Docker Installation](https://docs.docker.com/engine/install/)
- Docs for [Docker Compose Installation](https://docs.docker.com/compose/install/)
### Deployment options
There are two options to deploy ToolJet using Docker Compose:
1. **With in-built PostgreSQL database (recommended)**. This setup uses the official Docker image of PostgreSQL.
2. **With external PostgreSQL database**. This setup is recommended if you want to use a managed PostgreSQL service such as AWS RDS or Google Cloud SQL.
Confused about which setup to select? Feel free to ask the community via Slack: https://tooljet.com/slack.
<Tabs>
<TabItem value="with-in-built-postgres" label="With in-built PostgreSQL" default>
1. Download our production docker-compose file into the server.
```bash
curl -LO https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/docker/docker-compose-db.yaml
mv docker-compose-db.yaml docker-compose.yaml
mkdir postgres_data
```
2. Create `.env` file in the current directory (where the docker-compose.yaml file is downloaded as in step 1):
```bash
curl -LO https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/docker/.env.internal.example
curl -LO https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/docker/internal.sh && chmod +x internal.sh
mv .env.internal.example .env && ./internal.sh
```
3. To start the docker container, use the following command:
```bash
docker-compose up -d
```
4. **(Optional)** `TOOLJET_HOST` environment variable can either be the public ipv4 address of your server or a custom domain that you want to use. Which can be modified in the .env file.
Also, for setting up additional environment variables in the .env file, please check our documentation on [environment variable](/docs/setup/env-vars)
Examples:
`TOOLJET_HOST=http://12.34.56.78` or
`TOOLJET_HOST=https://tooljet.yourdomain.com`
If you've set a custom domain for `TOOLJET_HOST`, add a `A record` entry in your DNS settings to point to the IP address of the server.
:::info
i. Please make sure that `TOOLJET_HOST` starts with either `http://` or `https://`
ii. Setup docker to run without root privileges by following the instructions written here https://docs.docker.com/engine/install/linux-postinstall/
iii. If you're running on a linux server, `docker` might need sudo permissions. In that case you can either run:
`sudo docker-compose up -d`
:::
</TabItem>
<TabItem value="with-external-postgres" label="With external PostgreSQL">
1. Setup a PostgreSQL database and make sure that the database is accessible.
2. Download our production docker-compose file into the server.
```bash
curl -LO https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/docker/docker-compose.yaml
```
3. Create `.env` file in the current directory (where the docker-compose.yaml file is downloaded as in step 1):
Kindly set the postgresql database credentials according to your external database. Please enter the database details with the help of the bash as shown below.
<div style={{textAlign: 'center'}}>
<img className="screenshot-full" src="/img/setup/docker/bash.gif"/>
</div>
```bash
curl -LO https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/docker/.env.external.example
curl -LO https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/docker/external.sh && chmod +x external.sh
mv .env.external.example .env && ./external.sh
```
4. To start the docker container, use the following command:
```bash
docker-compose up -d
```
5. **(Optional)** `TOOLJET_HOST` environment variable can either be the public ipv4 address of your server or a custom domain that you want to use. Which can be modified in the .env file.
Also, for setting up additional environment variables in the .env file, please check our documentation on [environment variable](/docs/setup/env-vars)
Examples:
`TOOLJET_HOST=http://12.34.56.78` or
`TOOLJET_HOST=https://tooljet.yourdomain.com`
If you've set a custom domain for `TOOLJET_HOST`, add a `A record` entry in your DNS settings to point to the IP address of the server.
:::info
i. Please make sure that `TOOLJET_HOST` starts with either `http://` or `https://`
ii. If there are self signed HTTPS endpoints that Tooljet needs to connect to, please make sure that `NODE_EXTRA_CA_CERTS` environment variable is set to the absolute path containing the certificates.
iii. If you're running a linux server, `docker` might need sudo permissions. In that case you can either run:
`sudo docker-compose up -d`
iv. Setup docker to run without root privileges by following the instructions written here https://docs.docker.com/engine/install/linux-postinstall/
:::
</TabItem>
</Tabs>
## Upgrading to the Latest Version
The latest version includes architectural changes and, hence, comes with new migrations.
If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.
#### Prerequisites for Upgrading to the Latest Version:
- It is **crucial to perform a comprehensive backup of your database** before starting the upgrade process to prevent data loss.
- Ensure that your current version is v2.23.0-ee2.10.2 before upgrading.
- Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the latest version.
For specific issues or questions, refer to our **[Slack](https://tooljet.slack.com/join/shared_invite/zt-25438diev-mJ6LIZpJevG0LXCEcL0NhQ#)**.

View file

@ -1,90 +0,0 @@
---
id: ec2
title: AWS EC2
---
# AWS EC2
:::info
You should setup a PostgreSQL database manually to be used by the ToolJet server.
:::
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*
Follow the steps below to deploy ToolJet on AWS EC2 instances.
1. Setup a PostgreSQL database and make sure that the database is accessible from the EC2 instance.
2. Login to your AWS management console and go to the EC2 management page.
3. Under the `Images` section, click on the `AMIs` button.
4. Find the [ToolJet version](https://github.com/ToolJet/ToolJet/releases) you want to deploy. Now, from the AMI search page, select the search type as "Public Images" and input the version you'd want `AMI Name : tooljet_vX.X.X.ubuntu_bionic` in the search bar.
5. Select ToolJet's AMI and bootup an EC2 instance.
Creating a new security group is recommended. For example, if the installation should receive traffic from the internet, the inbound rules of the security group should look like this:
protocol| port | allowed_cidr|
----| ----------- | ----------- |
tcp | 22 | your IP |
tcp | 80 | 0.0.0.0/0 |
tcp | 443 | 0.0.0.0/0 |
6. Once the instance boots up, SSH into the instance by running `ssh -i <path_to_pem_file> ubuntu@<public_ip_of_the_instance>`
7. Switch to the app directory by running `cd ~/app`. Modify the contents of the `.env` file. ( Eg: `vim .env` )
The default `.env` file looks like this:
```bash
TOOLJET_HOST=http://<example>
LOCKBOX_MASTER_KEY=<example>
SECRET_KEY_BASE=<example>
PG_DB=tooljet_prod
PG_USER=<pg user name>
PG_HOST=<pg host>
PG_PASS=<pg user password>
```
Read **[environment variables reference](/docs/setup/env-vars)**
:::info
If there are self signed HTTPS endpoints that Tooljet needs to connect to, please make sure that `NODE_EXTRA_CA_CERTS` environment variable is set to the absolute path containing the certificates.
:::
8. `TOOLJET_HOST` environment variable determines where you can access the ToolJet client. It can either be the public ipv4 address of your instance or a custom domain that you want to use.
Examples:
`TOOLJET_HOST=http://12.34.56.78` or
`TOOLJET_HOST=https://yourdomain.com` or
`TOOLJET_HOST=https://tooljet.yourdomain.com`
:::info
We use a [lets encrypt](https://letsencrypt.org/) plugin on top of nginx to create TLS certificates on the fly.
:::
:::info
Please make sure that `TOOLJET_HOST` starts with either `http://` or `https://`
:::
9. Once you've configured the `.env` file, run `./setup_app`. This script will install all the dependencies of ToolJet and then will start the required services.
10. If you've set a custom domain for `TOOLJET_HOST`, add a `A record` entry in your DNS settings to point to the IP address of the EC2 instance.
12. You're all done, ToolJet client would now be served at the value you've set in `TOOLJET_HOST`.
## Upgrading to the Latest Version
The latest version includes architectural changes and, hence, comes with new migrations.
If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.
#### Prerequisites for Upgrading to the Latest Version:
- It is **crucial to perform a comprehensive backup of your database** before starting the upgrade process to prevent data loss.
- Ensure that your current version is v2.23.0-ee2.10.2 before upgrading.
- Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the latest version.
For specific issues or questions, refer to our **[Slack](https://tooljet.slack.com/join/shared_invite/zt-25438diev-mJ6LIZpJevG0LXCEcL0NhQ#)**.

View file

@ -1,112 +0,0 @@
---
id: ecs
title: AWS ECS
---
# Deploying ToolJet on Amazon ECS
:::info
You should setup a PostgreSQL database manually to be used by ToolJet.
:::
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*
Follow the steps below to deploy ToolJet on a ECS cluster.
1. Setup a PostgreSQL database
ToolJet uses a postgres database as the persistent storage for storing data related to users and apps.
2. Create a target group and an application load balancer to route traffic onto ToolJet containers.
You can [reference](https://docs.aws.amazon.com/AmazonECS/latest/userguide/create-application-load-balancer.html) AWS docs to set it up. Please note that ToolJet server exposes `/api/health`, which you can configure for health checks.
:::note
This setup follows the old AWS UI for ECS as some options are missing on the latest experience.
:::
3. Create task definition for deploying ToolJet app as a service on your preconfigured cluster.
1. Select Fargate as launch type compatibility.
<img className="screenshot-full" src="/img/setup/ecs/launch-type-compatibility.png" alt="select launch type compatibility" />
2. Configure IAM roles and set operating system family as Linux
<img className="screenshot-full" src="/img/setup/ecs/task-definition-config.png" alt="task definition config" />
3. Select task size to have 3GB of memory and 1vCpu
<img className="screenshot-full" src="/img/setup/ecs/task-size.png" alt="task size config" />
4. Click on add container to update container definitions
<img className="screenshot-full" src="/img/setup/ecs/add-container-button.png" alt="add container button" />
Within the add container form that is shown:
- Specify your container name ex: `tooljet-ce`
- Set the image you intend to deploy. ex: `tooljet/tooljet-ce:v1.26.0`
- Update port mappings at container port `3000` for tcp protocol.
<img className="screenshot-full" src="/img/setup/ecs/container-setup.png" alt="container setup" />
- Update container command field to be `npm,run,start:prod`.
<img className="screenshot-full" src="/img/setup/ecs/container-command.png" alt="container command" />
- Specify environmental values for the container. You'd want to make use of secrets to store sensitive information or credentials, kindly refer the AWS [docs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html) to set it up.
<img className="screenshot-full" src="/img/setup/ecs/container-env-setup.png" alt="container env setup" />
:::note
For the minimal setup, ToolJet requires:
`TOOLJET_HOST`, `PG_HOST`, `PG_DB`, `PG_USER`, `PG_PASSWORD`, `SECRET_KEY_BASE` & `LOCKBOX_MASTER_KEY` keys in the secret.
Read **[environment variables reference](/docs/setup/env-vars)**
:::
4. Create a service to run your task definition within your cluster.
- Select launch type as Fargate.
- Set operating system family as Linux
- Select task definition family as the one created earlier. ex: `tooljet-ce`
- Select the cluster and set the service name
- You can set the number of tasks to start with as two
- Rest of the values can be kept as default
<img className="screenshot-full" src="/img/setup/ecs/service-config.png" alt="service config" />
- Click on next step to configure networking options
- Select your designated VPC, Subnets and Security groups. Kindly ensure that the security group allows for inbound traffic to http port 3000 for the task.
<img className="screenshot-full" src="/img/setup/ecs/service-security-group-config.png" alt="service security group config" />
- Since migrations are run as a part of container boot, please specify health check grace period for 900 seconds.
- Select the application loadbalancer option and set the target group name to the one we had created earlier. This will auto populate the health check endpoints.
:::info
The setup above is just a template. Feel free to update the task definition and configure parameters for resources and environment variables according to your needs.
:::
5. Verify if ToolJet is running by checking by checking the status of the tasks in the created service.
### Creating default admin workspace and account
You can create a new revision of your existing task definition to have a one time task to seed with default admin.
1. Create a new revision from your existing task definition.
You can change task definition name to `tooljet-seed-task`
2. Click on your existing container name to edit container.
3. Change container command from `npm,run,start:prod` to `npm,run,db:seed:prod`
4. Go back to your cluster dashboard and click on Run new task.
<img className="screenshot-full" src="/img/setup/ecs/run-new-task.png" alt="run new task" />
5. Configure your run task with the `tooljet-seed-task` for your cluster. It should look like:
<img className="screenshot-full" src="/img/setup/ecs/run-task-config.png" alt="run task config" />
6. Click on run task to have this task seed the database with user having following credentials:
- email: `dev@tooljet.io`
- password: `password`
## Upgrading to the Latest Version
The latest version includes architectural changes and, hence, comes with new migrations.
If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.
#### Prerequisites for Upgrading to the Latest Version:
- It is **crucial to perform a comprehensive backup of your database** before starting the upgrade process to prevent data loss.
- Ensure that your current version is v2.23.0-ee2.10.2 before upgrading.
- Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the latest version.
For specific issues or questions, refer to our **[Slack](https://tooljet.slack.com/join/shared_invite/zt-25438diev-mJ6LIZpJevG0LXCEcL0NhQ#)**.

View file

@ -1,254 +0,0 @@
---
id: env-vars
title: Environment variables
---
# Environment variables
Both the ToolJet server and client requires some environment variables to start running.
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*
## ToolJet server
#### ToolJet host ( required )
| variable | description |
| ------------ | --------------------------------------------------------------- |
| TOOLJET_HOST | the public URL of ToolJet client ( eg: https://app.tooljet.com ) |
#### Lockbox configuration ( required )
ToolJet server uses lockbox to encrypt datasource credentials. You should set the environment variable `LOCKBOX_MASTER_KEY` with a 32 byte hexadecimal string.
#### Application Secret ( required )
ToolJet server uses a secure 64 byte hexadecimal string to encrypt session cookies. You should set the environment variable `SECRET_KEY_BASE`.
:::tip
If you have `openssl` installed, you can run the following commands to generate the value for `LOCKBOX_MASTER_KEY` and `SECRET_KEY_BASE`.
For `LOCKBOX_MASTER_KEY` use `openssl rand -hex 32`
For `SECRET_KEY_BASE` use `openssl rand -hex 64`
:::
#### Database configuration ( required )
ToolJet server uses PostgreSQL as the database.
| variable | description |
| -------- | ---------------------- |
| PG_HOST | postgres database host |
| PG_DB | name of the database |
| PG_USER | username |
| PG_PASS | password |
:::tip
If you are using docker-compose setup, you can set PG_HOST as `postgres` which will be DNS resolved by docker
:::
### Disable database and extension creation (optional)
ToolJet by default tries to create database based on `PG_DB` variable set and additionally my try to create postgres extensions. This requires the postgres user to have CREATEDB permission. If this cannot be granted you can disable this behaviour by setting `PG_DB_OWNER` as `false` and will have to manually run them.
#### Check for updates ( optional )
Self-hosted version of ToolJet pings our server to fetch the latest product updates every 24 hours. You can disable this by setting the value of `CHECK_FOR_UPDATES` environment variable to `0`. This feature is enabled by default.
#### Comment feature enable ( optional )
Use this environment variable to enable/disable the feature that allows you to add comments on the canvas.
| variable | value |
| -------- | ---------------------- |
| COMMENT_FEATURE_ENABLE | `true` or `false` |
#### Multiplayer feature enable ( optional )
Use this environment variable to enable/disable the feature that allows users to collaboratively work on the canvas.
| variable | value |
| -------- | ---------------------- |
| ENABLE_MULTIPLAYER_EDITING | `true` or `false` |
#### Marketplace feature enable ( optional )
Use this environment variable to enable/disable the feature that allows users to use the marketplace.
| variable | value |
| -------- | ---------------------- |
| ENABLE_MARKETPLACE_FEATURE | `true` or `false` |
#### Server Host ( optional )
You can specify a different server for backend if it is hosted on another server.
| variable | value |
| -------- | ---------------------- |
| SERVER_HOST | Configure a hostname for the server as a proxy pass. If no value is set, it defaults to `server`. |
#### Disable Multi-Workspace ( optional )
If you want to disable Multi-Workspace feature, set the environment variable `DISABLE_MULTI_WORKSPACE` to `true`.
### Hide account setup link
If you want to hide account setup link from admin in manage user page, set the environment variable `HIDE_ACCOUNT_SETUP_LINK` to `true`, please make sure you have configured SMTP to receive welcome mail for users. Valid only if `DISABLE_MULTI_WORKSPACE` is not `true`.
#### Disabling signups ( optional )
Sign up is enabled only if Multi-Workspace is enabled. If you want to restrict the signups and allow new users only by invitations, set the environment variable `DISABLE_SIGNUPS` to `true`.
:::tip
You will still be able to see the signup page but won't be able to successfully submit the form.
:::
#### Serve client as a server end-point ( optional )
By default, the `SERVE_CLIENT` variable will be unset and the server will serve the client at its `/` end-point.
You can set `SERVE_CLIENT` to `false` to disable this behaviour.
#### Serve client at subpath
If ToolJet is hosted on a domain subpath, you can set the environment variable `SUB_PATH` to support it.
Please note the subpath is to be set with trailing `/` and is applicable only when the server is serving the frontend client.
#### SMTP configuration ( optional )
ToolJet uses SMTP services to send emails ( Eg: invitation email when you add new users to your workspace ).
| variable | description |
| ------------------ | ----------------------------------------- |
| DEFAULT_FROM_EMAIL | from email for the email fired by ToolJet |
| SMTP_USERNAME | username |
| SMTP_PASSWORD | password |
| SMTP_DOMAIN | domain or host |
| SMTP_PORT | port |
#### Slack configuration ( optional )
If your ToolJet installation requires Slack as a data source, you need to create a Slack app and set the following environment variables:
| variable | description |
| ------------------- | ------------------------------ |
| SLACK_CLIENT_ID | client id of the slack app |
| SLACK_CLIENT_SECRET | client secret of the slack app |
#### Google OAuth ( optional )
If your ToolJet installation needs access to data sources such as Google sheets, you need to create OAuth credentials from Google Cloud Console.
| variable | description |
| -------------------- | ------------- |
| GOOGLE_CLIENT_ID | client id |
| GOOGLE_CLIENT_SECRET | client secret |
#### Google maps configuration ( optional )
If your ToolJet installation requires `Maps` widget, you need to create an API key for Google Maps API.
| variable | description |
| ------------------- | ------------------- |
| GOOGLE_MAPS_API_KEY | Google maps API key |
#### APM VENDOR ( optional )
Specify application monitoring vendor. Currently supported values - `sentry`.
| variable | description |
| ---------- | ----------------------------------------- |
| APM_VENDOR | Application performance monitoring vendor |
#### SENTRY DNS ( optional )
| variable | description |
| ---------- | ----------------------------------------- |
| SENTRY_DNS | DSN tells a Sentry SDK where to send events so the events are associated with the correct project |
#### SENTRY DEBUG ( optional )
Prints logs for sentry.
| variable | description |
| ---------- | ----------------------------------------- |
| SENTRY_DEBUG | `true` or `false`. Default value is `false` |
#### Server URL ( optional)
This is used to set up for CSP headers and put trace info to be used with APM vendors.
| variable | description |
| ------------------ | ----------------------------------------------------------- |
| TOOLJET_SERVER_URL | the URL of ToolJet server ( eg: https://server.tooljet.com ) |
#### RELEASE VERSION ( optional)
Once set any APM provider that supports segregation with releases will track it.
#### NODE_EXTRA_CA_CERTS (optional)
Tooljet needs to be configured for custom CA certificate to be able to trust and establish connection over https. This requires you to configure an additional env var `NODE_EXTRA_CA_CERTS` to have absolute path to your CA certificates. This file named `cert.pem` needs to be in PEM format and can have more than one certificates.
| variable | description |
| ------------------ | ----------------------------------------------------------------- |
| NODE_EXTRA_CA_CERTS | absolute path to certificate PEM file ( eg: /ToolJet/ca/cert.pem ) |
#### Disable telemetry ( optional )
Pings our server to update the total user count every 24 hours. You can disable this by setting the value of `DISABLE_TOOLJET_TELEMETRY` environment variable to `true`. This feature is enabled by default.
#### Password Retry Limit (Optional)
The maximum retry limit of login password for a user is by default set to 5, account will be locked after 5 unsuccessful login attempts. Use the variables mentioned below to control this behavior:
| variable | description |
| ------------------------------------- | ----------------------------------------------------------- |
| DISABLE_PASSWORD_RETRY_LIMIT | (true/false) To disable the password retry check, if value is `true` then no limits for password retry |
| PASSWORD_RETRY_LIMIT | To change the default password retry limit (5) |
#### SSO Configurations (Optional)
Configurations for instance level SSO. Valid only if `DISABLE_MULTI_WORKSPACE` is not `true`.
| variable | description |
| ------------------------------------- | ----------------------------------------------------------- |
| SSO_GOOGLE_OAUTH2_CLIENT_ID | Google OAuth client id |
| SSO_GIT_OAUTH2_CLIENT_ID | GitHub OAuth client id |
| SSO_GIT_OAUTH2_CLIENT_SECRET | GitHub OAuth client secret |
| SSO_GIT_OAUTH2_HOST | GitHub OAuth host name if GitHub is self hosted |
| SSO_ACCEPTED_DOMAINS | comma separated email domains that supports SSO authentication |
| SSO_DISABLE_SIGNUPS | Disable user sign up if authenticated user does not exist |
## ToolJet client
#### Server URL ( optionally required )
This is required when client is built separately.
| variable | description |
| ------------------ | ----------------------------------------------------------- |
| TOOLJET_SERVER_URL | the URL of ToolJet server ( eg: https://server.tooljet.com ) |
#### Server Port ( optional)
This could be used to for local development, it will set the server url like so: `http://localhost:<TOOLJET_SERVER_PORT>`
| variable | description |
|---------------------|-----------------------------------------|
| TOOLJET_SERVER_PORT | the port of ToolJet server ( eg: 3000 ) |
#### Asset path ( optionally required )
This is required when the assets for the client are to be loaded from elsewhere (eg: CDN).
This can be an absolute path, or relative to main HTML file.
| variable | description |
| ------------------ | ----------------------------------------------------------- |
| ASSET_PATH | the asset path for the website ( eg: https://app.tooljet.com/) |
#### Serve client as a server end-point ( optional )
By default the client build will be done to be served with ToolJet server.
If you intend to use client separately then can set `SERVE_CLIENT` to `false`.

View file

@ -1,162 +0,0 @@
---
id: google-cloud-run
title: Google Cloud Run
---
# Deploying ToolJet on Google Cloud Run
:::info
You should setup a PostgreSQL database manually to be used by ToolJet.
:::
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*
Follow the steps below to deploy ToolJet on Cloud run with `gcloud` CLI.
## Deploying ToolJet application
1. Cloud Run requires prebuilt image to be present within cloud registry. You can pull specific tooljet image from docker hub and then tag with your project to push it to cloud registry.
*Ensure you change `replace-with-your-project-id` in the below command with your project ID.*
```bash
gcloud auth configure-docker
docker pull tooljet/tooljet:EE-LTS-latest
docker tag tooljet/tooljet:EE-LTS-latest gcr.io/replace-with-your-project-id/tooljet/tooljet:EE-LTS-latest
docker push gcr.io/replace-with-your-project-id/tooljet/tooljet:EE-LTS-latest
```
2. Deploy new cloud run service
:::info
This command takes the assumption that certain required environment has already been created in secrets. If you haven't created already then use the [secret manager](https://console.cloud.google.com/security/secret-manager).
:::
```bash
gcloud run deploy tooljet-ce --image gcr.io/<replace-your-project-id>/tooljet/tooljet-ce:latest \
--allow-unauthenticated \
--cpu 1 \
--memory 1Gi \
--min-instances 1 \
--set-env-vars "TOOLJET_HOST=https://<replace-your-public-host>.com" \
--set-secrets "PG_HOST=PG_HOST:latest" \
--set-secrets "PG_DB=PG_DB:latest" \
--set-secrets "PG_USER=PG_USER:latest" \
--set-secrets "PG_PASS=PG_PASS:latest" \
--set-secrets "LOCKBOX_MASTER_KEY=LOCKBOX_MASTER_KEY:latest" \
--set-secrets "SECRET_KEY_BASE=SECRET_KEY_BASE:latest" \
--args "npm,run,start:prod"
```
Update `TOOLJET_HOST` environment variable if you want to use the default url assigned with Cloud run after the initial deploy.
:::tip
If you are using [Public IP](https://cloud.google.com/sql/docs/mysql/connect-run) for Cloud SQL, then database host connection (value for `PG_HOST`) needs to be set using unix socket format, `/cloudsql/<CLOUD_SQL_CONNECTION_NAME>`. Additionally you will also have to set this flag with the above command:
```
--set-cloudsql-instances <CLOUD_SQL_CONNECTION_NAME>
```
where `<CLOUD_SQL_CONNECTION_NAME>` is the name of the connection to your Cloud SQL instance, which you can find on its settings page.
:::
3. Create default user (Optional)
Signing up requires [SMTP configuration](https://docs.tooljet.com/docs/setup/env-vars#smtp-configuration--optional-) to be done, but if you want to start off with default user you can run the command by modifying the `args` flag for a one time usage.
```bash
gcloud run deploy <replace-service-name> \
--image gcr.io/<replace-your-project-id>/tooljet/tooljet-ce:latest \
--args "npm,run,--prefix,server,db:seed"
```
The deployment will fail as it runs a seed script. Check logs to see that default user was created. Now run the following command to have the app deployed.
```bash
gcloud run deploy <replace-service-name> \
--image gcr.io/<replace-your-project-id>/tooljet/tooljet-ce:latest \
--args "npm,run,start:prod"
```
The default username of the admin is `dev@tooljet.io` and the password is `password`.
## Deploying only ToolJet server
1. Cloud Run requires prebuilt image to be present within cloud registry. You can pull specific tooljet image from docker hub and then tag with you project to push it to cloud registry.
```bash
gcloud auth configure-docker
docker pull tooljet/tooljet-server-ce:latest
docker tag tooljet/tooljet-server-ce:latest gcr.io/<replace-your-project-id>/tooljet/tooljet-server-ce:latest
docker push gcr.io/<replace-your-project-id>/tooljet/tooljet-server-ce:latest
```
2. Deploy new cloud run service
:::info
This command takes the assumption that certain required environment has already been created in secrets. If you haven't created already then use the [secret manager](https://console.cloud.google.com/security/secret-manager).
:::
```bash
gcloud run deploy tooljet-server-ce --image gcr.io/<replace-your-project-id>/tooljet/tooljet-server-ce:latest \
--allow-unauthenticated \
--cpu 1 \
--memory 1Gi \
--min-instances 1 \
--set-env-vars "SERVE_CLIENT=false" \
--set-env-vars "TOOLJET_HOST=https://<replace-your-public-host>.com" \
--set-secrets "PG_HOST=PG_HOST:latest" \
--set-secrets "PG_DB=PG_DB:latest" \
--set-secrets "PG_USER=PG_USER:latest" \
--set-secrets "PG_PASS=PG_PASS:latest" \
--set-secrets "LOCKBOX_MASTER_KEY=LOCKBOX_MASTER_KEY:latest" \
--set-secrets "SECRET_KEY_BASE=SECRET_KEY_BASE:latest" \
--args "npm,run,start:prod"
```
:::tip
If you are using [Public IP](https://cloud.google.com/sql/docs/mysql/connect-run) for Cloud SQL, then database host connection (value for `PG_HOST`) needs to be set using unix socket format, `/cloudsql/<CLOUD_SQL_CONNECTION_NAME>`. Additionally you will also have to set this flag with the above command:
```
--set-cloudsql-instances <CLOUD_SQL_CONNECTION_NAME>
```
where `<CLOUD_SQL_CONNECTION_NAME>` is the name of the connection to your Cloud SQL instance, which you can find on its settings page.
:::
:::info
If there are self signed HTTPS endpoints that Tooljet needs to connect to, please make sure that `NODE_EXTRA_CA_CERTS` environment variable is set to the absolute path containing the certificates. The certificate can be mount as a volume onto the container using secrets.
:::
3. Create default user **(Optional)**
Signing up requires [SMTP configuration](https://docs.tooljet.com/docs/setup/env-vars#smtp-configuration--optional-) to be done, but if you want to start off with default user you can run the command by modifying the `args` flag for a one time usage.
```bash
gcloud run deploy <replace-service-name> \
--image gcr.io/<replace-your-project-id>/tooljet/tooljet-server-ce:latest \
--args "npm,run,db:seed:prod"
```
The deployment will fail as it only runs a seed script. Check logs to see that default user was created. Now run the following command to have the app deployed.
```bash
gcloud run deploy <replace-service-name> \
--image gcr.io/<replace-your-project-id>/tooljet/tooljet-server-ce:latest \
--args "npm,run,start:prod"
```
The default username of the admin is `dev@tooljet.io` and the password is `password`.
## Upgrading to the Latest Version
The latest version includes architectural changes and, hence, comes with new migrations.
If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.
#### Prerequisites for Upgrading to the Latest Version:
- It is **crucial to perform a comprehensive backup of your database** before starting the upgrade process to prevent data loss.
- Ensure that your current version is v2.23.0-ee2.10.2 before upgrading.
- Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the latest version.
For specific issues or questions, refer to our **[Slack](https://tooljet.slack.com/join/shared_invite/zt-25438diev-mJ6LIZpJevG0LXCEcL0NhQ#)**.

Some files were not shown because too many files have changed in this diff Show more