multi line text field variable adding to notification with formating

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 06:42 PM - edited 02-18-2024 02:40 PM
I have a variable that is a multi line text field.
When someone enters text into it, that they have formatted into separate lines eg:
This is my text line 1.
This is my second line.
The third line.
When that gets passed into a notification for instance, it loses all formatting and gets added as a single line, such as:
This is my text line 1.This is my second line.The third line.
Any ideas of how to make it appear as separate lines?
Anyone else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 06:48 PM
Hi @Bidduam ,
I am not sure if there is any direct way or a easy way to do this like with a single command but what u can do is while fetching the variable from multi line text split by ('\n') . Then while adding it in ur notification u can make use of email script run a for loop & print it. Just a suggestion
Thanks,
Danish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:05 PM
Hi @Bidduam
The challenge is when you are pulling the value, it is passing of line breaks as ('\n'), but when it comes to the Rich HTML editor, it doesn't recognize this and expects ('<br>').
My suggestion would be to create an email script, to replace the '\n' with '<br>'
To understand the behavior better, give below article a go:
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:26 PM - edited 02-15-2024 07:30 PM
This isn't coming through with /n in it to start with I don't believe. So nothing to replace.
It's just plain text. Is there a way to say after every full stop to add a new line or something before adding the next bit of text?
For example I tried this and it obviously hasn't worked, but is it on the right track at all or am I just not even close?
var newline = current.variables.question10.replace(".", "\n");
template.print('<li> ' + newline + '.<br>');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:31 PM
Can you check in the HTML editor, if those tags are coming in, once you place the field in the body.
Full stop can also be the option, but I believe that is not a good delimiter, not every line should end in full-stop and who is going to enforce that for end users.
Aman Kumar