Skip to main content

JavaScript Column Usage

How to create a JavaScript column in the data editor

Updated over 3 weeks ago

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

  1. Open the Data Editor in Glide

  2. Click the ➕ icon to add a new column

  3. Choose Computed>Experimental>Code, then select the JavaScript column

  4. Name your column and select one or more inputs (e.g. other columns in your table)

  5. Write your JavaScript using those inputs, referenced as p1, p2, p3.

Writing JavaScript

  • p1, p2, p3. represent the columns you selected as inputs

  • Always 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:

  1. Add a JavaScript column

  2. Set First Name as p1 and Last Name as p2

  3. 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 through p3)

  • Lodash functions (e.g. _.escape(p1)) are supported

  • Make 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

Did this answer your question?