Forum Discussion

GaryDoucet's avatar
GaryDoucet
Qrew Cadet
8 years ago

Trying to set the background color on a field with a condition. Keep getting errors.

Trying to set the background color on a field with the following condition. Its not working. 

If(Contains([Cut Status], "Fabrication Ready"), "<div style=\"background-color:#0CF52B;\">("[Digital Front]"&"-Rev"&"[Revision]")</div>", [Cut Status])

Is this possible to do?
  • UrsulaLl's avatar
    UrsulaLl
    Qrew Assistant Captain
    I'm assuming the "& -Rev &" is part of the text to go inbetween digital front field and revision field.
    Using the \ to escape out the quotes works, but it makes it harder to read, so I have replaced that with single quotes. The & needs to be in front and behind the QB field you are using. Hope this works!

    If(Contains([Cut Status], "Fabrication Ready"), 
    "<div style='background-color:#0CF52B;'>(" & [Digital Front] & "-Rev" & [Revision] & ")</div>",
    [Cut Status])
  • Thanks Ana.

    This is effecting the Contains Statement now. Like I think this should work.  

  • UrsulaLl's avatar
    UrsulaLl
    Qrew Assistant Captain
    If(Contains([Cut Status], "Fabrication Ready", 
    "<div style='background-color:#0CF52B;'>(" & [Digital Front] & "-Rev" & [Revision] & ")</div>", 
    [Cut Status]))

    See if that works
  • Ok this Works.  I changed the List box just to a Text field and did this Formal and it Worked.


    So this issue has to be with the Contains Function.