Skip to main content
Question

Formula Text field loses formatting of referenced field

  • January 12, 2017
  • 0 replies
  • 142 views

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])
This topic has been closed for replies.

Can you give the formula and an example of what data is in the field in an example record and how its rendering?.

Updated OP

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.

Thanks for the help!

Forum|alt.badge.img
  • Registered
  • November 9, 2017
don't you just need to click the enable HTML checkbox in the field settings? maybe I am not understanding the question