# Max body/text length

**URL:** <https://community.n8n.io/t/max-body-text-length/3734>\
**Category:** Questions\
**Created:** [7. Januar 2021 um 21:41 UTC](https://community.n8n.io/t/max-body-text-length/3734 "2021-01-07T21:41:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damian\_K](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/damian_k/32/2586_2.png) [@Damian\_K](https://community.n8n.io/u/Damian_K)\
**Post date:** [7. Januar 2021 um 21:41 UTC](https://community.n8n.io/t/max-body-text-length/3734/1 "2021-01-07T21:41:46Z")

</div>

Hello,

Before i start messing around with function nodes, Is there a way to have a max text length as an expression?

---

<div class="post-metadata">

**Author:** ![Damian\_K](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/damian_k/32/2586_2.png) [@Damian\_K](https://community.n8n.io/u/Damian_K)\
**Post date:** [7. Januar 2021 um 21:59 UTC](https://community.n8n.io/t/max-body-text-length/3734/2 "2021-01-07T21:59:35Z")

</div>

and, (I wasnt sure i should’ve created a new thread for this)

Is there a way to do this with any kind of text?

 ![](https://europe1.discourse-cdn.com/n8n/original/2X/6/6076441309ed4a7a1182d656f9351338c245c54a.png)

Since i just need the Text, Not the HTML

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [8. Januar 2021 um 05:21 UTC](https://community.n8n.io/t/max-body-text-length/3734/3 "2021-01-08T05:21:58Z")

</div>

Hey,  
Sorry but I am not sure what exactly you want to do. Can you please provide a bit more detail?  
Thanks

---

<div class="post-metadata">

**Author:** ![Damian\_K](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/damian_k/32/2586_2.png) [@Damian\_K](https://community.n8n.io/u/Damian_K)\
**Post date:** [8. Januar 2021 um 06:46 UTC](https://community.n8n.io/t/max-body-text-length/3734/4 "2021-01-08T06:46:01Z")

</div>

I got a string of html with text in it, I just need the text

For the max length i figured out i can do this  
`{{$node["IF"].json["Body"].slice(0, 75)}}`

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [8. Januar 2021 um 07:02 UTC](https://community.n8n.io/t/max-body-text-length/3734/5 "2021-01-08T07:02:39Z")

</div>

You’ll have to enter a CSS selector in the _ **CSS Selector** _ field. This can be a class (append with a ‘.’), an id (append with ‘#’) or an HTML tag.  
The _ **Key** _ field sets the key for the value that will be returned. For example, if you’re extracting links, your key can be `Link` and the CSS selector can be `a` (for the anchor tag).

Below is an example workflow that returns text that is wrapped by the HTML tag containing the class `link-primary`.

I hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![Damian\_K](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/damian_k/32/2586_2.png) [@Damian\_K](https://community.n8n.io/u/Damian_K)\
**Post date:** [8. Januar 2021 um 07:15 UTC](https://community.n8n.io/t/max-body-text-length/3734/6 "2021-01-08T07:15:41Z")

</div>

I got it to work 😉 Had to figure out i needed put something else in then “data”

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [8. Januar 2021 um 07:32 UTC](https://community.n8n.io/t/max-body-text-length/3734/7 "2021-01-08T07:32:07Z")

</div>

That’s great! Have fun 🙂
