โ10-12-2023 02:03 PM - edited โ10-12-2023 02:07 PM
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
Solved! Go to Solution.
โ10-12-2023 03:04 PM - edited โ10-12-2023 03:08 PM
Thanks. I think the output is correct when I do this:
But after the next step to send the email
I get this error.
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 !
โ10-12-2023 02:25 PM - edited โ10-12-2023 02:26 PM
When you pluck a single field, the result is a flat array of values, so using to_csv creates a CSV with a single row (no line breaks).
If you add a second value to your pluck it will make a two-dimensional array (an array of arrays), and to_csv will add line breaks between each secondary array.
If you don't want to pluck a second value, you can drop to_csv and use [rows].pluck('output').split('\n')
โ10-12-2023 03:04 PM - edited โ10-12-2023 03:08 PM
Thanks. I think the output is correct when I do this:
But after the next step to send the email
I get this error.
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 !
โ10-12-2023 03:10 PM
Try setting the body input to text and not formula mode.
No problem! Happy to help : )
โ10-12-2023 03:24 PM - edited โ10-12-2023 03:26 PM
No error, but my email result is 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 "]]