Forum Discussion

DanielleW's avatar
DanielleW
Qrew Member
3 years ago

Converting Multi-Line Text to Formula - Rich Text, Issue with Line Breaks

I have read every single post on this board regarding this subject, and have tried every suggestion and nothing is working. Please help!

I'm trying to take a user input Multi-Line Text field and convert it into a Rich Text field.


When converting it directly to RT, it takes out line breaks. When I do SearchAndReplace, nothing:

SearchAndReplace([Schedule],"\n","<br>")​


I've tried the following codes for line breaks / carriage returns, and none of them have worked:

\n
\r
\\
\\n
\\r
<br>
<cr>
<enter>
<return>
<crlf>
<nl>
<newline>
&nsbp;
&crarr;

I even set up a debug field to display "this one" if the [Schedule] field contained any of the code/characters above. I'm completely at a loss, can someone help?

------------------------------
Danielle Wilczewski
------------------------------
  • Hi all,

    Thanks for this post as it helped me find a solution! With the new function URLDecode, I was able to use some of what was mentioned here to get the line breaks to appear in a formula-rich text field that was pulling in the value from a multi-line text field. Here's what I did: use URL Encode, then replace the "%0A" with "<br>", and then use the URL Decode function.
    URLDecode(SearchAndReplace(URLEncode([Status - Required Action and Documentation]),"%0A","<br>"))

  • Thank you to all who messaged me privately as well as Prashant for responding here.

    We were able to find a solution, but it's hugely complicated. We took the Multi-Line Text field and in a rich text field, we were able to URL Encode, and then SearchAndReplace for each special character the user might use in their inputs.

    Moving forward, we are going to streamline the input process to make this much easier.

    ------------------------------
    Danielle W
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      Danielle, are you able to post your final resolution?  I see tat you would have had to do successive SeachAndReplace operations for every special character to "Un-URLEncode" them.

      ------------------------------
      Mark Shnier (YQC)
      mark.shnier@gmail.com
      ------------------------------
  • Try Semicolon , this if from FORMS 

    var text CombinedText = ToText(YOUR FIELD HERE);

    var text RemoveSpaceAfterSemiColon = SearchAndReplace($CombinedText, "; ",";");

    // substitute new line for semicolon
    var text rone=SearchAndReplace($RemoveSpaceAfterSemiColon,";","\n");

    ------------------------------
    Prashant Maheshwari
    ------------------------------