Help

Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Script - remove whitespace from the beginning of the text

Solved
Jump to Solution
236 3
cancel
Showing results for 
Search instead for 
Did you mean: 

" Hello Airtable"

  • need to remove initial white-space from the text in the script.
1 Solution

Accepted Solutions

It sounds like you are putting this in the scripting block. This formula will only work in a Formula type column.

Without knowing what your script is you can try something like:

let text = "       Hello World!        ";
let result = text.trim();

See Solution in Thread

3 Replies 3

Hi @Ujval_Shah ,
You should be able to do this with a formula field with TRIM(string)

It’s throwing error.

ReferenceError: TRIM is not defined at main on line 2

It sounds like you are putting this in the scripting block. This formula will only work in a Formula type column.

Without knowing what your script is you can try something like:

let text = "       Hello World!        ";
let result = text.trim();