Hello,
I tried to set a message on several lines using a variable with \n but in the Text view node, the whole message is displayed on the same line.
Would you have a suggestion?
Thanks,Regards,
Claire
Hello,
I tried to set a message on several lines using a variable with \n but in the Text view node, the whole message is displayed on the same line.
Would you have a suggestion?
Thanks,Regards,
Claire
Hey Claire,
if you overwrite the whole content with a flow variable, you would need to use “<br />
” instead of \n. The reason for this is that the Text View expects HTML as input if the whole content is overwritten.
Greetings and hope this helps,
Daniel
TextViewNewLine.knwf (12.9 KB)
Hi Daniel,
Thanks for your help. I was unable to check your workflow as I use a previous version (5.2.5). I tried to simulate a variable with text on two lines but it does not work for me. See screen shot.
Best,
Claire
Hey @Claire,
sorry I just noticed that I left out the most important part of my message. (sorry)
Apparently the forum chat automatically transforms this into a newline.
You would need to use <br/> <br>: The Line Break element - HTML | MDN
Instead of \n
Greetings,
Daniel
Hi @DanielBog , I’ve taken the liberty of editing your previous message so that the <br />
is now displayed, to make it clearer for future readers!
While I’m here @Claire, I’m just adding an example screenshot showing the <br>
tag in operation:
Hi All,
Thanks a lot. I got it working on my side as well. I realized that the whole message has to be in the variable. If you use a mix of text and a variable in the Text View node, it won’t work. See screen shot
Hi @Claire , you may be interested in this related link
You’ll see that there I created a component that can act as a means of converting text containing variables into a single variable that can be used with Text view. It may be of assistance to you.