Widget Variable Message Carriage Return

I’m trying to create a Description variable for a Widget (I used the Boolean Widget in my example). The Description is going to need a carriage return (again, as a variable).

I’ve tried a sort of variations like Line 1\r\nLine 2 (and Line 1\nLine 2 and Line 1\\nLine 2, etc.).

image

I know you can put carriage returns when entered in the configuration window. What’s the secret sauce to getting the carriage return in there as a variable?

Thanks in advance,
Phil

Hello @philcremer,

You can achieve this by using multiple variables in the variable creator, one variable for each line. In your example above first variable value would be “Line 1” and second variable value is “Line 2”. Then use a string manipulation node to join both the variable with “\n” in between :

join($${Svariable_1}$$,"\n",$${Svariable_2}$$)

Below is a GIF demonstrating this. Hope this helps.

2024-06-13_14h21_13

Best,
Keerthan

2 Likes

Genius!!! More than anything else, thank you for doing the animation!!! This being a free Q&A, you get 10 points!!!

You may redeem those 10 points from whatever KNIME kiosk is out there.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.