Display Text, first five words

Is there a way to display the first five words of a text column besides using the Ai generate text column?

I have a text value and would like to create a column displaying the first five words…

You can use a JavaScript column:

return p1.split(' ').slice(0,5).join(' ');

That works great thanks.

How would you customise this to add a ellipsis when the input text is longer than 5 words?

Possible, but have you looked at the Truncate Text column?

Might be a bit simpler than messing around with JavaScript…

That’s perfect!
Didn’t know the Truncated Text Column existed.