Forum Discussion

DiegoMendoza1's avatar
DiegoMendoza1
Qrew Trainee
9 years ago

Colorized List Formula

I currently have a text formula that creates a list that looks like this:
List("\n",ToText( [Field 1])&" "&"Width",
ToText([Field 2])&" "&"Length",
ToText([Field 3])&" "&"Depth")

I want this list to be colorized so i created a formula like so:
"<span style=\"color:red;font-weight:bold;\">"&  [Colored List]&"</span>"

But when It displays it doesn't display as a list, it simply displays everything in one line.

What am i doing wrong? Thank you.
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    I believe you need to 'style' each individual item WITHIN the list function.

    however, I'm sure you will have to style things differently in total to get that affect.
  • ChrisChris's avatar
    ChrisChris
    Qrew Assistant Captain

    You will need to embed your html into the list code:

    List ("\n","<span style='color:red;font-weight:bold;'>"ToText([Field 2])&"</span>"...


    • DiegoMendoza1's avatar
      DiegoMendoza1
      Qrew Trainee
      Thank you. I tried it and it still doesn't list the items. Displays a single line. What could i be doing wrong?

      List("\n","<span style=\"color:red;font-weight:bold;\">"&  ToText([Width])&"</span>",
      "<span style=\"color:green;font-weight:bold;\">"&  ToText([Length])&"</span>",
      "<span style=\"color:blue;font-weight:bold;\">"&  ToText([Depth])&"</span>")
    • ChrisChris's avatar
      ChrisChris
      Qrew Assistant Captain
      Let's try the "\n" at the end of each item. ...&"</span>"&"\n"&
  • EricMohlman's avatar
    EricMohlman
    Quickbase Staff
    The \n is a newline character, which works for regular formulas. Once you check the "allow some HTML" you now need to use the HTML new line character. I just tested in a dummy app to confirm this works:
    "<span style=\"color:red;font-weight:bold;\">" & List("<br />",[Field1] & " Width",[Field2] & " Length",[Field3] & " Depth") & "</span>