Using the JavaScript Column in Glide
The JavaScript column lets you run custom JavaScript directly in your Glide app. It’s ideal for advanced data manipulation or logic that goes beyond Glide’s built-in computed columns.
⚠️ The JavaScript column is experimental. It may change in the future and is not officially supported by Glide. Use it cautiously in production apps.
What You Can Do With It
Format strings, numbers, arrays, or objects
Build custom formulas and conditional logic
Use Lodash (a utility library) for advanced data handling
How to Add a JavaScript Column
Open the Data Editor in Glide
Click the ➕ icon to add a new column
Choose Computed>Experimental>Code, then select the JavaScript column
Name your column and select one or more inputs (e.g. other columns in your table)
Write your JavaScript using those inputs, referenced as
p1
,p2
,p3
.
Writing JavaScript
p1
,p2
,p3
. represent the columns you selected as inputsAlways end with a
return
statement
Example Syntax
return p1 + " " + p2;
Example: Format a Full Name
Let’s say you have two columns:
First Name
Last Name
You want a formatted version like: Lastname, Firstname
Steps:
Add a JavaScript column
Set
First Name
asp1
andLast Name
asp2
Enter this code:
const first = _.capitalize(p1);
const last = _.capitalize(p2);
return last + ", " + first;
Result:
If p1
is MICHAEL and p2
is SMITH, the result will be:
Smith, Michael
Tips
You can use up to 3 inputs (
p1
throughp
3)Lodash functions (e.g.
_.escape(p1)
) are supportedMake sure to return a value or the result will be empty
Common Use Cases
Cleaning up and formatting text
Conditional logic (like
if
/else
)Generating custom strings or values not possible with other column types
Limitations
Complex column types like lists, arrays, and objects are not supported as inputs or output. For example, you cannot return an array directly. Instead, use something like
myArray.join(",")
to return a plain text string.This feature is experimental and may change without notice.
Glide Support does not assist with writing or debugging JavaScript.
Learn More
Explore examples and community tips here:
👉 JavaScript Column in the Plugin Gallery
Need help? Ask the Glide Community