Skip to main content
Solved

Add break (carriage return) to line item aggregation

  • June 8, 2026
  • 4 replies
  • 66 views

Forum|alt.badge.img+6

I have an automation that aggregates all the line items for an invoice - see attached image…

 

That works fine but I would like to have each item be on its own line. So somehow I need to be able to insert a break <br> presumably. Not willing to go to Make or Zapier for this.

 

How can I do this?

 

 

Best answer by TheTimeSavingCo

Hm, I just realized that if we want new lines without the comma and are okay with using a script then we don’t even need the formula field.  I’ve added it to the base as an automation called ‘No leading new line, remove commas’

You can duplicate it to your own workspace to view the settings more in depth!

The automation will:

  1. Use a ‘Find Record’ step to find the records you want
  2. Sort them in the order you want
  3. Separate each value with a new line
  4. Update the original record with the new line separated value

 

And here’s the script:

output.set(
'text',
input.config().text
.join('\n')
.trim()
)

 

 

 


Got the first part to work, but why does JavaScript add a comma?

I take it you’re referring to the commas in red below?

1,

2,

3

If so, that’s being done by the ‘Find Record’ action

---

Not sure how to handle your code snippet. Don’t I need to get the field value and then update it?

Yeap, that’s what the script is doing!  We pass in the value in the left sidebar:

 

 

4 replies

TheTimeSavingCo
Forum|alt.badge.img+32

10 June 26 edit:  This solution works but I found a better way to do it and posted it below, so I’m going to put the original solution under a spoiler tag to save the time of future readers!
 

 
Does this look right?  If so I’ve set it up here for you to check out!

The idea is to create a formula field that’ll put a new line in front of the value you want to display and to use that value in the automation instead:

' \n' & Name

 

This is nice because it doesn't use a script, but it results in a leading newline and I’m not sure if you’re okay with that.  To get rid of it we’d use a Run Script step to trim it out and you can find it in the base linked above as well:

 

Setup:

output.set('text', input.config().text.toString().trim())

Let me know if you have any issues setting it up!

 

 


Forum|alt.badge.img+6
  • Author
  • Inspiring
  • June 9, 2026

Got the first part to work, but why does JavaScript 

' \n'

add a comma?

 

Not sure how to handle your code snippet. Don’t I need to get the field value and then update it?


TheTimeSavingCo
Forum|alt.badge.img+32

Hm, I just realized that if we want new lines without the comma and are okay with using a script then we don’t even need the formula field.  I’ve added it to the base as an automation called ‘No leading new line, remove commas’

You can duplicate it to your own workspace to view the settings more in depth!

The automation will:

  1. Use a ‘Find Record’ step to find the records you want
  2. Sort them in the order you want
  3. Separate each value with a new line
  4. Update the original record with the new line separated value

 

And here’s the script:

output.set(
'text',
input.config().text
.join('\n')
.trim()
)

 

 

 


Got the first part to work, but why does JavaScript add a comma?

I take it you’re referring to the commas in red below?

1,

2,

3

If so, that’s being done by the ‘Find Record’ action

---

Not sure how to handle your code snippet. Don’t I need to get the field value and then update it?

Yeap, that’s what the script is doing!  We pass in the value in the left sidebar:

 

 


Forum|alt.badge.img+6
  • Author
  • Inspiring
  • June 11, 2026

That works great. Thank you also for pointing out the variable input on the left hand pane - something that I was blind to previously.