Skip to main content
Version: 2.50.0-LTS

Workspace Constants

Workspace constants are predefined values(usually tokens/secret keys/API keys) that can be used across your application to maintain consistency and facilitate easy updates. They allow you to store important data or configurations that should remain unchanged during the application's runtime. This doc will guide you through the usage and management of workspace constants within your workspaces.


Workspace constants are handled server-side and are not intended for use in query transformations or RunJS and RunPy queries. For these operations, employ variables and page variables instead.

Environment-Specific Configurations

Users can define environment-specific configurations by setting different values for constants across environments. It is useful for managing sensitive information such as API keys, database credentials, or external service endpoints. For Community edition only production environment is available and for Cloud/EE we will have multi environments (development, staging, production).

Server-Side Resolution

Workspace constants are designed to be resolved on the server side only. This means that when you make network calls, the payload sent will not include the actual values of the constants. Instead, the server will resolve the constants and use their actual values while processing the requests. This ensures that the constants remain secure and are not exposed to the client-side.
Workspace constants are encrypted before being stored in the database, providing an additional layer of security for sensitive data like API keys, tokens, and other confidential values.


Workspace constants encryption was introduced in ToolJet version 2.34.1. If you are upgrading from a version prior to 2.34.1, all your existing workspace constants will be automatically encrypted. You can continue utilizing the workspace constants as before, while benefiting from the added security provided by the encryption feature.

Access Control

Creating, updating, and deleting constants are exclusive privileges granted to Admins (workspaces). Only users with administrative rights can perform these operations. Workspace constants are specific to the workspace where they are created and cannot be utilized in other workspaces.

Usage in App Builder and Global Datasource Connection

All users with edit app permissions have access to consume and utilize constants in the app builder and global datasource connection forms. This enables you to use the same constant values across different components of your application, ensuring consistency and reducing duplication of effort.


To use a workspace constant, you need to follow the syntax: {{constants.constant_name}}. For example, if you have a constant named "psql_host", you can access its value by using {{constants.psql_host}}.

Creating Workspace Constants

To create workspace constants, follow these steps:

  • Access the ToolJet Dashboard and navigate to Workspace Settings.
  • Select the Workspace Constants tab.
  • Click on the Create New Constant button.
  • A drawer will appear. Enter the desired name and value for the constant.
  • Click the Add Constant button to save the constant.
Workspace constants: create
  • If you are an admin, you have the privilege to edit or delete constants. However, if you are a user with edit app permissions in the workspace, you can only view the constants and consume them in the app builder and global datasource connection forms.
Workspace constants: edit/delete

Using Workspace Constants

Workspace constants can be used in the app builder and the global datasource connection forms.

Using Workspace Constants in Global Datasource Connection

You can use workspace constants in the global datasource connection form to store sensitive information like API keys, tokens, etc. This will ensure that the data remains secure and is not exposed to the client-side. You can use the syntax {{constants.constant_name}} to access the value of the constant.

Workspace constants: global datasource

Using Workspace Constants in App Builder

Inside the App Builder, you will find the Inspector on the left sidebar. The inspector will have a Constants section which will be updated dynamically to display all the available constant values.

Workspace constants: inspector

As you build the application, you can easily refer to the constants and incorporate them into different elements of your app.

Workspace constants: querypanel

With workspace constants, you can streamline your application's configuration and maintain a consistent experience for your users. By leveraging this feature, you can ensure that vital data remains secure while making it accessible for authorized users throughout the application building process.