ToolJet/docs/versioned_docs/version-2.68.0/tooljet-concepts/run-js.md
Aman Regu bdfe3270e2
[docs]: v2.68.0-Beta (#10755)
* docs: jira

* docs: formatting + Client Credentials grant type

* docs: connection string pgsql

* docs: parameterized queries mysql

* docs: parameterized queries in PostgreSQL

* docs: update mysql example

* docs: TJDB sql editor

* docs: add metadata to REST API

* docs: add, update  postgresql media

* docs: add metadata to graphql

* docs: update parameterized queries

* docs: add parameterized queries for mssql

* docs: add SSL Cert to mysql

* docs: TJDB SQL restricted commands

* docs: update JIRA token location

* docs: update delete issue example

* docs: update find user by query example

* docs: remove session id from get assignable users

* docs: use correct image for get issues for board

* docs: update create issue example

* docs: update delete issue media

* docs: update assignable users media

* docs: update examples

* docs: update key desc

* docs: v2.68.0-Beta
2024-09-13 19:23:19 +05:30

31 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

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

---
id: 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 its 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/)**