ToolJet/docs/versioned_docs/version-2.65.0/tooljet-concepts/access-values.md
Aman Regu fed052a99b
[docs]: v2.65.0 (#10415)
* add date with time column

* add table component to date with time colum

* add aggregate and group by

* add docs for retry on network error

* add cookies

* add .env vars

* add docs for v2.65.0

* remove banner from v2.65.0

* update data types title

* update querying data title
2024-07-22 19:46:36 +05:30

1.6 KiB

id title
how-to-access-values Access Values

In ToolJet, double curly braces {{}} can be used to retrieve data returned by queries, access values related to components and pass custom code. You can see the list of all accessible values in the Inspector tab in the left sidebar.

Accessing Values

The queries keyword can be used to access data returned by queries. For example:{{queries.getSalesData.data}}

Similarly, the components keyword can be used to access data in the components and other component-related variables. For example: {{components.table1.selectedRow.id}}.

Check Available Values Using Inspector

Writing Custom Code

You can write custom JavaScript code to set colors, enable or disable toggles and more by passing in JavaScript code inside double curly braces. To change Background Color of a button based on the light or dark theme using fx (next to properties in properties panel), you can use a code that returns a string value of hex code.

For example, {{globals.theme.name == "light" ? "#375FCF" : "#FFFFFF"}}

Similary, to enable or disable a button based on user input using fx, you can write a JavaScript code that returns true or false.

For example, {{components.form1.data.textinput1 == "" ? true : false}}.