Formula-Text with multiple results in various color

  • 0
  • 1
  • Question
  • Updated 6 months ago
  • Answered
I have a list field called Status which I am using to display a message (in color) at the top of a page. 

My formula looks to Status field and when a status of "x" is found it displays "y" (an example is below).

I want to change the font size and color on the "y" value.

For example; when the Status is O-Pending, I want "Not Started" to be displayed on my form in Red and have a font size of 140% the normal font size. 

I am fairly new to this and would appreciate any help that can be provided!

[Status]="O-Pending","Not Started",
[Status]="O-HOLD", "On Hold",
[Status]="C-Closed-Request Complete", "Closed")
Photo of Jen Latkowski

Jen Latkowski

  • 80 Points 75 badge 2x thumb

Posted 6 months ago

  • 0
  • 1
Check out Kirk Trachy's Magic Buttons app on the Exchange. More formatting options than you can shake a year's worth of sticks at, with practical examples.
Photo of Forrest Parker

Forrest Parker

  • 1,332 Points 1k badge 2x thumb

I would create another table called "Status".  In that table you can have at least two fields.  One is the status itself, the other is the formatted text that you want to display for that status.  Make the second a Rich Text field.  This way you can format it anyway you want. 

Relate the Status Table to the table you are working in (Status is the parent table). Replace your formula field in your question with a lookup of the Rich Text field from your status table.  

With this solution you won't have to worry about figuring out the html and css required to format your text and you won't need to update your formula every time someone decides to change the wording of the statuses.

Hope this helps.
I used that solution myself with a "low code" client.

Note that you need to set the Key field of the Status choices table to be the Status words.