# Display Text, first five words

**URL:** https://community.glideapps.com/t/display-text-first-five-words/72930
**Category:** Ask for Help
**Created:** [April 29, 2024, 10:48am UTC](https://community.glideapps.com/t/display-text-first-five-words/72930 "2024-04-29T10:48:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Curtis](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/curtis/32/59826_2.png) [@Curtis](https://community.glideapps.com/u/Curtis)
#### Post date: [April 29, 2024, 10:48am UTC](https://community.glideapps.com/t/display-text-first-five-words/72930/1 "2024-04-29T10:48:28Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 29, 2024, 10:56am UTC](https://community.glideapps.com/t/display-text-first-five-words/72930/2 "2024-04-29T10:56:21Z")

</div>

You can use a JavaScript column:

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

```

 ![CleanShot 2024-04-29 at 18.56.03@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/2/02e5ee1b7f777ec3193be3beedb111aa866b4f69.png)

---

<div class="post-metadata">

### Author: ![Curtis](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/curtis/32/59826_2.png) [@Curtis](https://community.glideapps.com/u/Curtis)
#### Post date: [April 29, 2024, 11:03am UTC](https://community.glideapps.com/t/display-text-first-five-words/72930/3 "2024-04-29T11:03:54Z")

</div>

That works great thanks.

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

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 29, 2024, 11:05am UTC](https://community.glideapps.com/t/display-text-first-five-words/72930/4 "2024-04-29T11:05:26Z")

</div>

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

Might be a bit simpler than messing around with JavaScript…

---

<div class="post-metadata">

### Author: ![Curtis](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/curtis/32/59826_2.png) [@Curtis](https://community.glideapps.com/u/Curtis)
#### Post date: [April 29, 2024, 11:12am UTC](https://community.glideapps.com/t/display-text-first-five-words/72930/5 "2024-04-29T11:12:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [May 6, 2024, 11:12am UTC](https://community.glideapps.com/t/display-text-first-five-words/72930/6 "2024-05-06T11:12:42Z")

</div>

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