JavaScript Code runs custom JavaScript in Glide apps. With it, you can transform data, perform calculations, or connect to external APIs. The feature is available as the JavaScript Function computed column and the Run JavaScript Code action.
Enterprise Feature
This feature is available as an add-on to Enterprise plans. Contact sales to get started.
Writing the JavaScript Code
JavaScript Code requires a function named run that takes a JSON object as input and returns a JSON object as output.
export async function run(input) { // Your logic here return { result: "your output" }; }
The following packages are available for use in the code:
lodash— Utility library for data manipulationdate-fns— Date formatting and calculationsms— Convert time strings to millisecondsuuid— Generate unique identifiersfast-deep-equal— Deep equality comparison
Using a coding agent
Glide provides a JS Code Sandbox environment designed for use with coding agents.
A coding agent such as Claude Code can generate the JavaScript code for you based on a description of the desired functionality. This allows you to generate the code by describing the requirements with a prompt, and the agent you choose generates the code in code.js. You can then copy the code into the Function Code field in Glide.
JavaScript Function Computed Column
The JavaScript Function computed column executes code for each row in a table and returns the result as a dynamic value.
In the Data Editor, click the plus symbol to add a new column.
Navigate to Integrations → Run Javascript Code and select JavaScript Function.
Enter the JavaScript code in the Function Code field.
Add Input values by clicking + Add value to pass data from the row as key-value pairs.
Add Secrets like API keys by clicking + Add value to pass sensitive values securely—these map to
process.envvariables in the code.Click Done.
Run Javascript Code Action
The Run Javascript Code action executes JavaScript in response to user interactions or workflow triggers. Unlike the computed column, this action includes a Log Output URL field that captures console.log() output for debugging.
In the Layout Editor
In the Data Editor, create columns to store the Result and optionally the Log Output URL.
Select a component that supports actions (such as a Button).
Click the Action dropdown and navigate to Integrations → Run Javascript Code, then select Run Javascript Code.
Enter the JavaScript code in the Function Code field.
Add Input values by clicking + Add value to pass data as key-value pairs.
Add Secrets like API keys by clicking + Add value to pass sensitive values securely—these map to
process.envvariables in the code.Select a Result column to store the returned value.
Optionally, select a Log Output URL column to store a link to the console output for debugging.
In the Workflow Editor
In the Data Editor, create columns to store the Result and optionally the Log Output URL.
In the Workflows tab, create or edit a workflow.
Click the plus symbol to add an action.
Search for "Javascript" and select Run Javascript Code.
Enter the JavaScript code in the Function Code field.
Add Input values by clicking + Add value to pass data as key-value pairs.
Add Secrets like API keys by clicking + Add value to pass sensitive values securely—these map to
process.envvariables in the code.Expand the Results section to map output values to your columns or use them in subsequent workflow steps.
To learn more generally about Integrations in Glide, including how they affect app usage, check out the Introduction to Integrations.