Skip to main content
Best answer

How Do I Format a Dynamic List of Spreadsheet Rows into Separate Lines in Slack?


Forum|alt.badge.img

What I’m Trying to Do:

I’m automating a daily Slack message that announces the winners of a sales competition (Spiff). The number of winners varies daily (sometimes 3, sometimes 15+). I need Zapier to pull the winners from a Google Sheet and list them each on a new line in Slack.

What I’ve Tried:

  1. Step 1: "Get Many Spreadsheet Rows" (Google Sheets)

    • This correctly pulls all the winners from Column A of my "Yesterday’s Spiff Winners" sheet.
    • The output is comma-separated (CSV format) rather than separate lines.
  2. Step 2: "Formatter – Text to Line Item"

    • I used the Formatter by Zapier (Utilities > Text to Line Item) to split the CSV into separate line items.
    • This works in the Formatter preview, but Slack still receives a single comma-separated line.
  3. Step 3: "Formatter – Line Item to Text" (Using \n as a separator)

    • I tried converting the list back to text with \n as the separator.
    • However, Slack doesn’t interpret \n as a new line and displays it as plain text instead.

The Current Issue:

Instead of displaying each winner on a separate line, Slack formats them as:

 

“Yesterdays Spiff Winners: Rep 1, Rep 2, Rep 3”

 

I need it to appear like this: 

“Yesterdays Spiff Winners

Rep 1

Rep 2

Rep 3”

 

What I Need Help With:

  • How can I properly format and send the list with line breaks so that each name appears on a new line in Slack?
  • Is there a workaround in Zapier, or do I need to adjust my formatting differently?

I’d really appreciate any help or workarounds from those who have solved this before! Thanks in advance. 🙏

Best answer by Troy TessaloneBest answer by Troy Tessalone

@tylergarver 

Other options to try:

  • <br>
  • [:newline:]
  • [:return:]

 

Slack help link for formatting messages: https://slack.com/help/articles/202288908-Format-your-messages

 

Formatter help:

https://help.zapier.com/hc/en-us/articles/25380258676109-Use-Formatter-to-split-text-in-Zaps#h_01JAG1PGX8EX39WRGKK2JVJ96V

https://help.zapier.com/hc/en-us/articles/8496278339725-Find-and-replace-values-in-your-Zaps

 

View original
Did this topic help you find an answer to your question?

7 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi ​@tylergarver 

Help us have more info by posting screenshots showing how your Zap steps are outlined and configured in EDIT mode with the field mappings visible.


Forum|alt.badge.img
  • Author
  • New
  • 3 replies
  • February 25, 2025

Hey ​@Troy Tessalone. Thanks for taking a look. Here are the screenshots, let me know if you need anything more. 

 

 

I’m getting the list of sales reps who won yesterdays spiff from my google spreadsheet

 

 

 

Here is my source google spreadsheet with the list of names that won yesterday. The list changes each day, some days will have multiple winners, some days will have one winner. 
It’s correctly grabbing all of the rep names
It’s correctly grabbing all of the rep names
This is where I try and format the list of names that it grabs so that I can output multiple lines
I’ve attempted to add a “\n” separator or a “,” separator and neither of those work

 

It looks like it formats it right with “Output Item 1” , “Output Item 2” etc, but I need my slack message to include all of the output items as lines. 

 

Here is my slack message where I need to input the list of names under “Yesterdays Spiff Winners”
I chose “Output Text” because it includes all of the names that I need, but I can’t figure out how to format it to have a line break inbetween each name
It looks like this when I send the test, but I need it to have a line break in between each name. 

 


Troy Tessalone
Forum|alt.badge.img+14

@tylergarver 

Issue is because the GSheets Zap step is returning the rows as an array of arrays.

e.g. 1>1, 2>1

Nested arrays are not handled well in Zaps.

 

So try these steps:

  • Formatter > Utilities > Line Items to Text
    • You already have this step
  • Formatter > Text > Replace
    • From the previous step, map this variable: Output Text
      • This is a comma delimited text string
    • Configure to replace , with \n

 

 


 

 


Forum|alt.badge.img
  • Author
  • New
  • 3 replies
  • February 25, 2025

 

@Troy Tessalone Okay, I replaced it and now it’s formatting correctly, but for some reason Slack isn’t interpretting the \n as a new line. I attempted to add brackets, but it’s still not handling the \n command properly.  It looks like you managed to have the output appear as different lines, but I can’t get my output to show that. My output only shows the , replaced with \ n. Any ideas? 

Here’s the additional step I added
My output doesn’t look like your output

 

for some reason Slack isn’t interpreting the \n as a new line. 

I attempted adding the command in brackets, but it’s still not handling it properly

 


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30916 replies
  • Answer
  • February 25, 2025

Forum|alt.badge.img
  • Author
  • New
  • 3 replies
  • February 25, 2025

@Troy Tessalone [:newline:] worked!!! Thank god! Thank you so much!!!


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7442 replies
  • February 26, 2025

That’s awesome news, ​@tylergarver! 🎉 Really pleased Troy’s suggestion did the trick—nice one, ​@Troy Tessalone! 🙌

Seems like you’re all set for now, but feel free to reach out to the Community again if there’s anything else you need help with. In the meantime, happy Zapping! 😁⚡