Glide HomepageOpen Glide

Getting Started

Quickstart
Agent
Intro to Layout
Intro to the Data Editor
Data to Layout
Intro to Actions
Intro to Workflows
App Settings
Templates

Essentials

Data Sources
Basic Columns
Components
Security and User Data
Users
Publishing and Sharing

Automation

Actions
AI
Computed Columns
Integrations
Asana
Azure
Browser
CSV to JSON
Call API
Claude
Clearbit
Data Structures
Device Info
Discord
DocsAutomator
DocuSign
ElevenLabs
Files Integration
Giphy
GitHub
Gmail
Google Analytics
Google Calendar
Google Cloud
Google Cloud Vision
Google Gemini
Google Maps
Google Tag Manager
Gravatar
Hubspot
IFTTT Webhook
Image Editor
Intercom
JSON
JavaScript Code
Make
Meta Pixel
Microsoft Outlook
Microsoft Teams
Mixpanel
OpenAI Integration Setup
OpenAI and Glide
OpenGraph.io
OpenRouter
PDFMonkey
Pexels
Pinecone
PostHog
Push Notifications
QuickBooks
Radar
Replicate
Salesforce
Segment
Short.io
Slack
Stripe
Twilio
XML
Xero
Yelp
Zapier
ZenRows
Zendesk
urlbox
Workflows
View API Docs

Use Cases

Forms
Images in Glide
Conditions, Filtering, and Visibility
Duplicating Apps

Reference

Account
User Experience
Values
A new Glide, built for the AI age

A new Glide, built for the AI age.

The new Glide combines the power of generative AI with the visibility and control of spreadsheets and no-code.

  • Integrations
  • JavaScript Code

JavaScript Code

Execute custom JavaScript to transform data, perform calculations, and connect to external APIs.

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 manipulation

  • date-fns — Date formatting and calculations

  • ms — Convert time strings to milliseconds

  • uuid — Generate unique identifiers

  • fast-deep-equal — Deep equality comparison

Using a coding agent

[BLANK] JavaScript Code - Warning

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.

  1. In the Data Editor, click the plus symbol to add a new column.

  2. Navigate to Integrations → Run Javascript Code and select JavaScript Function.

  3. Enter the JavaScript code in the Function Code field.

  4. Add Input values by clicking + Add value to pass data from the row as key-value pairs.

  5. Add Secrets like API keys by clicking + Add value to pass sensitive values securely—these map to process.env variables in the code.

  6. 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

  1. In the Data Editor, create columns to store the Result and optionally the Log Output URL.

  2. Select a component that supports actions (such as a Button).

  3. Click the Action dropdown and navigate to Integrations → Run Javascript Code, then select Run Javascript Code.

  4. Enter the JavaScript code in the Function Code field.

  5. Add Input values by clicking + Add value to pass data as key-value pairs.

  6. Add Secrets like API keys by clicking + Add value to pass sensitive values securely—these map to

  7. process.env variables in the code.

  8. Select a Result column to store the returned value.

  9. Optionally, select a Log Output URL column to store a link to the console output for debugging.

In the Workflow Editor

  1. In the Data Editor, create columns to store the Result and optionally the Log Output URL.

  2. In the Workflows tab, create or edit a workflow.

  3. Click the plus symbol to add an action.

  4. Search for "Javascript" and select Run Javascript Code.

  5. Enter the JavaScript code in the Function Code field.

  6. Add Input values by clicking + Add value to pass data as key-value pairs.

  7. Add Secrets like API keys by clicking + Add value to pass sensitive values securely—these map to process.env variables in the code.

  8. 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.

Frequently Asked Questions

Have a question about JavaScript Code? Ask the Glide community.
Need more help? Hire an Expert.

Updated more than a week ago

Previous

JSON

Next

Make

Was this article helpful?
Exit Preview Mode