mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-22 22:17:55 +00:00
* add getter function and table transformation docs * add dropdown, number-input, password-input and text-input docs * [docs] custom parameters for queries * update docs for revamped components, runJS and runPy functions and sidebar * change order of properties and other misc changes * update query panel and other minor fixes * added version 2.29.0 --------- Co-authored-by: Shubhendra <withshubh@gmail.com>
31 lines
1.9 KiB
Markdown
31 lines
1.9 KiB
Markdown
---
|
||
id: run-js
|
||
title: Run JavaScript code
|
||
---
|
||
|
||
The **Run JavaScript code** query in ToolJet enables users to write and execute custom JavaScript code within their applications. It provides a flexible way to add custom logic and interact with various components. Whether it’s transforming data, manipulating component properties, or performing actions based on certain conditions, Run JavaScript code significantly enhances the capabilities of your ToolJet applications.
|
||
|
||
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
|
||
|
||
## Interacting with Components and Actions
|
||
The JavaScript code you write can interact with various components of the ToolJet application. For example, you could attach an event handler to a button so that when it's clicked, it triggers Run Javascript code to run. Additionally, you can construct the JavaScript code to manipulate the properties of other components. This allows for dynamic interactions within your application.
|
||
|
||
<div style={{textAlign: 'center'}}>
|
||
<img className="screenshot-full" src="/img/tooljet-concepts/run-js/run-js-preview.png" alt="Preview Of Run JS" />
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div style={{paddingTop:'24px', paddingBottom:'24px'}}>
|
||
|
||
## Advanced Features and Libraries
|
||
Run JavaScript code also supports advanced functionalities such as setting and unsetting variables, showing or closing modals, copying content to the clipboard, and even logging out users. This is done by using specific syntax and functions. Moreover, you can utilize libraries like Moment, Lodash, and Axios for more complex operations.
|
||
|
||
</div>
|
||
|
||
To learn more about Run JavaScript code, go through the below list of documents:
|
||
|
||
- **[Use Axios in RunJS](/docs/how-to/use-axios-in-runjs/)**
|
||
- **[Run Actions From RunJS](/docs/how-to/run-actions-from-runjs/)**
|
||
- **[Import External Libraries Using RunJS](/docs/how-to/import-external-libraries-using-runjs/)**
|
||
- **[Access a User's Location Using RunJS](/docs/how-to/access-users-location/)**
|