Help

Re: How can I shorten a long text field for an automation Message (on Slack)?

Solved
Jump to Solution
2108 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Alexandra_CD
5 - Automation Enthusiast
5 - Automation Enthusiast

I feel this is super simple and I’m just not seeing something. If someone could put me out of my misery, it would be much appreciated. I want to send slack notifications when someone fills out a form. One of the fields is long text and asks for detailed description. I wanted to only show a preview of that field in the message. I see the “trim” option there but I don’t know how to actually use it! It’s not doing what I assume it should do.

I am selecting + > the field (Description) > Continue > trim (insert) and it doesn’t do anything. When I do the exact same with any of the other properties (length, upper case, lower case, etc) it does react the way I would expect.

Does anyone know how to do this? :thinking:

See it not working here:
Screen Shot 2021-06-21 at 6.49.04 PM
Screen Shot 2021-06-21 at 6.50.06 PM

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

trim removes leading and trailing space characters. It does not shorten long text that does not have leading or trailing spaces. Instead you can use a formula field that shortens the text.

See Solution in Thread

6 Replies 6
kuovonne
18 - Pluto
18 - Pluto

trim removes leading and trailing space characters. It does not shorten long text that does not have leading or trailing spaces. Instead you can use a formula field that shortens the text.

Thank you @kuovonne ! Nothing came up when I searched for that “trim”, that makes complete sense. I can make a new field with Formula and LEFT() to have 200 characters of message. Is that what you meant? Or can I use formulas in the automation message, I didn’t figure out how.

Yes, that’s it. If you want to get fancy, you can have the formula add ellipsis if there are more than 200 characters, and you can get even fancier and try to get the formula to break between words, but these formulas can get complex.

Here is a simplified version of one of the formulas that I use to get an excerpt from a long text field. It assumes that words a separated by spaces and that no word is longer than 20 characters. It won’t always be the maximum length, but it will break between words.

IF(
    LEN({Content}) > 200,
    LEFT(
        {Content}, 
        FIND(" ", {Content}, 180)
    )  & "...",
    {Content}
)
Alexandra_CD
5 - Automation Enthusiast
5 - Automation Enthusiast

Perfect! Thank you so much! That’s definitely fancier than what I need, I just did a Formula “short description” with LEFT(*Description*,200) and then in the automation message I added that field followed by …

But your fancier IF will make someone searching for this very happy I’m sure. Thank you for that.

Hate to be that scope creeper person but would you happen to know if there’s a function or formula (be it in field or in the automation message configuration) so I can put a link in hyperlink (want to make the record link hyperlinked into a word so the long, ugly url isn’t part of the slack notification).

If you are sending out your notification as an automated email, you can include a link in markdown format.
[text you see](https://example.com)

You may need to experiment with escaping the url if it contains underscores or other special characters. Different methods of composing the message have different effects.

No, it’s as a slack message. Seems markdown doesn’t work for the slack message automation. I think this is Slack’s limitation though since it won’t recognize that same markdown if I write it as a message directly on slack. Airtable would have to add the hyperlinking feature I guess so the message is sent to slack already hyperlinked. Anyway, THANK YOU @kuovonne !