Formula Text field loses formatting of referenced field | Discussions

Expand all | Collapse all

Formula Text field loses formatting of referenced field

  • 1.  Formula Text field loses formatting of referenced field

    Posted 01-12-2017 15:40
    I have a formula text field with HTML enabled that is just doing an If statement and then choosing between 2 existing text fields for its data. What's happening is when the formula text field is displayed, the formatting is lost. I believe what's happening is that it's treating the referenced field as pure text. I couldn't find a function that would preserve the formatting to HTML.

    Suggestions?



    Edit:

    Example text field:

    Hello

    How are you today?

    Results: Hello How are you today?



    Formula Text Field:

    if(Trim([Field1])="","<span style=\"color:red;\">"&[Field2]&"</span>",[Field1])


  • 2.  RE: Formula Text field loses formatting of referenced field

    Posted 01-12-2017 15:42
    Can you give the formula and an example of what data is in the field in an example record and how its rendering?.


  • 3.  RE: Formula Text field loses formatting of referenced field

    Posted 01-12-2017 16:19
    Updated OP


  • 4.  RE: Formula Text field loses formatting of referenced field

    Posted 01-12-2017 16:24
    So is your question that that you are losing the New Line carriage return when you convert to HTML?


  • 5.  RE: Formula Text field loses formatting of referenced field

    Posted 01-12-2017 16:55
    Exactly, along with all white space being truncated to a single space. It seems like it's just dumping it out as text and treating the entire field as HTML.


  • 6.  RE: Formula Text field loses formatting of referenced field

    Posted 01-12-2017 16:58
    Yes, well, when a text field is in html the white spaces will be compressed to one space and the  \n which is a carriage return type hidden character will not be recognized.  So that formatting will be lost.  Which I guess was your original question.  So we are where we were.


  • 7.  RE: Formula Text field loses formatting of referenced field

    Posted 01-13-2017 03:36
    Hah! If there was a string replace I could swap the carriage return for an html break but I haven't seen a solution for that so far. Can JavaScript be used in a formula field?


  • 8.  RE: Formula Text field loses formatting of referenced field

    Posted 01-13-2017 03:38
    You would have to contact Dan Diebolt  or a QuickBase Solution Provider with that kind of expertise for a non native solution, I suspect.  I don't have an answer for you.


  • 9.  RE: Formula Text field loses formatting of referenced field

    Posted 01-13-2017 03:55
    Thanks for the help!


  • 10.  RE: Formula Text field loses formatting of referenced field

    Posted 11-09-2017 18:29
    don't you just need to click the enable HTML checkbox in the field settings? maybe I am not understanding the question