Forum Discussion

MichaelMichael4's avatar
MichaelMichael4
Qrew Member
8 years ago

Formula Text field loses formatting of referenced field

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])

9 Replies

  • Can you give the formula and an example of what data is in the field in an example record and how its rendering?.
  • So is your question that that you are losing the New Line carriage return when you convert to HTML?
  • 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.
  • 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.
  • 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?
  • 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.
  • UrsulaLl's avatar
    UrsulaLl
    Qrew Assistant Captain
    don't you just need to click the enable HTML checkbox in the field settings? maybe I am not understanding the question