Skip to main content

Regular Expressions | How to Send Comma-Separated Text as Line Breaks in Slack

Y
Written by Yoom
Updated this week

📝 Overview

This guide will show you how to send a message that was originally obtained as a comma-separated list, with each item on a new line, in Slack. This technique is useful when sending messages or content created in a spreadsheet.

Here is an example of the Flowbot setup for this process. Let’s go over the detailed steps.


🛠️ How to Set Up

1. Retrieve the Text

  • Go to Integrate with Apps > Google Sheets > Retrieve Values.

  • Enter the required fields.

  • Run a test and confirm the request is successful.

  • You’ll see that the output ("Test Value") is comma-separated (shown in red in the image). However, if you send it to Slack directly, the message will remain in this format. In the next step, we’ll adjust the data.

2. Replace Commas ( , ) with Line Breaks ( \n )

  • Go to Data Conversion > Replace Data.

  • In the condition settings, set it up using the following parameters:

    • Target Text for Replacement: Set this to the output of the text you retrieved.

    • Search for: ,

    • Replace With: \n

  • After testing, you’ll see that the commas ( , ) have been replaced with line breaks ( \n ), making the message ready to be sent with line breaks.

3. Create and Set the Message in Chatwork/Slack

  • Go to Slack > Send message to Channel.

  • Set the retrieved values from step 2 into the message field for Slack.

  • Here’s the final look of the message when sent

  • You can confirm that the message has been sent with proper line breaks as expected.

That’s it! 🎉

You've successfully formatted the comma-separated text into a message with line breaks for Slack.


📚 Related Guides

Related Keywords

Regular Expressions, Chatwork, Slack, Line Breaks, Data Transformation, Comma-Separated List, Text Formatting, Flowbot, Spreadsheet Integration, Message Formatting, Replace Comma with Line Break, App Integration

Did this answer your question?