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(' ');

2 Likes

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…

1 Like

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

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.