Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Insert a carriage return for a new line within the same cell

6 - Meteoroid
Hi, Alteryx expect,

I have a need to insert two carriage return for a long string into new lines when seeing  special characters, for example my current string is:"index1 is 10 and index2 is 20"
that I want to change to within the same field:

index 1 is 10

index2 is 20  

is there is functions to insert a carriage return with the Formula? or Regex has this feature? Thanks!
5 - Atom

The Email widget only respects newlines if you type out the Body portion and have them there. If, like me, you need to have the Body be a field because it's constructed in the flow, you need to make sure your field has <br /> tags in it to get newlines. 


If your "fullBody" formula is something like 

[body1] + "

" + [body2] + "

" + [body3]


It will look OK in a preview, but passing this to "Body: Use a field" in the Email widget will turn the newlines into spaces in the HTML formatted message.


If you want to pass newlines into "Body: Use a field" your fullBody formula would need to be

[body1] + "<br />"

+[body2] + "<br />"

+ [body3]