cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Put CSV Output on New Lines ?

dunncrew
Deputy Chef III
Deputy Chef III

I am reading 1 text field from a SQL Server select rows and want to send them in an email. Currently, it puts all the records on one line, but I want each record on a new line. Any suggestions ? I tried to force a "New line" break, but no luck.

See Screen-shots and result data (3 records sample) below.

Instead of this

    10/11/2023  10:16     Jones, Mary,   Computer Room    ,    10/11/2023  10:54     Smith, Frank,   Computer Room    ,    10/11/2023  15:56     Amos, Henry,   Computer Room   

I want

10/11/2023  10:16     Jones, Mary,   Computer Room     

10/11/2023  10:54     Smith, Frank,   Computer Room   

10/11/2023  15:56     Amos, Henry,   Computer Room  

dunncrew_0-1697144608116.png

dunncrew_1-1697144623817.png

 

 

 

 

1 ACCEPTED SOLUTION

dunncrew
Deputy Chef III
Deputy Chef III

Thanks. I think the output is correct when I do this:

dunncrew_0-1697148126645.png

But after the next step to send the email

dunncrew_1-1697148193921.png

I get this error.

dunncrew_2-1697148257175.png

Also, It looks like I can "trick" it into making a 2 dimensional array by PLUCKing a blank instead of a 2nd field, but it puts a comma off to the right to separate the imaginary 2nd blank field from valid field 1

P.S.  Thanks for all your help the last few days !

 

 

 

 

View solution in original post

8 REPLIES 8

gary1
Executive Chef III
Executive Chef III

D'oh! My bad. Try this:

[rows].pluck('output').join('\n')

dunncrew
Deputy Chef III
Deputy Chef III

it treats the '\n' as a character string, not a line break. Do I need square brackets [ ] or something to code it as a line break ?

gary1
Executive Chef III
Executive Chef III

In the Outlook action, is the body format set to text or HTML? "\n" should work if it's set to text.

If it's HTML, you'll need this:

[rows].pluck('output').join('<br>')

dunncrew
Deputy Chef III
Deputy Chef III

Thanks. <br> with HTML worked.