Multiline text variable loses carriage return in email

  • 5 April 2023
  • 6 replies

Userlevel 1
Badge +4

I am using the Create a text string action to build up a list in a foreach loop. When I write the contents of the variable in Log to instance details, each item is on its own line. 

When I add that same variable to an email, all of the items end up on the same line. 

How can I fix this so that each item is on its own line in the email, just as it appears when I log to instance details?



Best answer by Garrett 6 April 2023, 00:15

View original

6 replies

Userlevel 6
Badge +16

Hi @Michele 


Try to use one of the following HTML Tags when you build up your Text string

  • HTML Breaks <br>.
    Line 1 <br>
    Line 2 <br>
    Line 3 <br> 
  • HTML paragraph  <p>This line </p> 
    <p> Line 1 </p>
    <p> Line 2 </p>
    <p> Line 3 </p>


Userlevel 1
Badge +4

Thanks for your response! How do you insert HTML in the “Create a text string”? Wouldn’t it just add those characters to your text as literals? 

Userlevel 6
Badge +16

How are you building your text string in the loop?


Userlevel 1
Badge +4

Thank you, @Garrett ! 

I’m using Operations - Create a text string.

I just did what you suggested by wrapping the line in <p></p> tags. And the html tags do not display in the email, but indeed format the email correctly. 

I was thinking you had to do something to explicitly tell Nintex you were using html, but apparently in the email body, it just recognizes html strings automatically. This makes sense now that I understand it. And I see that the email Message body is formatted with html by default. It’s just hidden unless you explicitly click on the html button.

Thanks again!


Userlevel 6
Badge +16

You’re welcome @Michele 


If you want better control over the text formatting, look into using HTML tables 


Userlevel 1
Badge +4

Great idea! Thank you. I will keep that in mind for the future. 

And now I have to decide which answer to mark as the best! :-)