Skip to main content
Question

Set URL Button Color based on Field Value

  • June 9, 2020
  • 0 replies
  • 52 views

Forum|alt.badge.img+6
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
------------------------------
This topic has been closed for replies.

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
------------------------------