Forum Discussion

ROBERTSACHS's avatar
ROBERTSACHS
Qrew Cadet
4 years ago

Set URL Button Color based on Field Value

Is there a way to change the color of a URL button based on the value in another field?  I track projects, and have a status field, say the status is either Pending or Completed.
I have a button to generate an email to the client.  I want the color of the button to be the default color (gray) while the status is pending, but when the status is set to Completed, the button color is updated to green (as a visual reminder to send the email).

So when status is pending:


and when Status is set to Complete:

There is no native function to set the color of the button, but is there a way to set the color of the button on the page itself?


ā€‹

------------------------------
ROBERT SACHS
------------------------------

2 Replies

  • PaulPeterson1's avatar
    PaulPeterson1
    Qrew Assistant Captain
    You can use inline CSS properties to change the color of the button in the formula.

    The approach I normally use is to create a variable containing the formula for the button then use an if statement to display the button I want to see.  

    for example:

    var text buttonOne = formula one;
    var text buttonTwo = formula two;

    If(condition, $buttonOne, $buttonTwo)

    ------------------------------
    Paul Peterson
    ------------------------------
    • ROBERTSACHS's avatar
      ROBERTSACHS
      Qrew Cadet
      Paul, thanks for the response.  However, perhaps my question suggested that I had a greater sophistication than in fact I do.   I get the concept of what you are saying, but have no idea how to implement.  Can you provide sample code?

      ------------------------------
      ROBERT SACHS
      ------------------------------