How can I base the color of Button on an "If then statement"?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
  • (Edited)
Original post by in the former community durning migration:
  • Asked by Brad
  • 20 days ago


I would like to leverage Nathan Thompson awesome blog about Building a better button (link to blog below)...

Trying to understand the code for the formula text field I would need...If I wanted to include multiple If then statements to determine the color of the button.....thanks for any advice



https://azastudio.squarespace.com/consulting-1/2017/1/10/building-better-buttons




var text url="http://www.example.com"

var text bt="Active"; 

var text bc="Vibrant Success"; 

"" & $bt & ""



II got it working!
Photo of Dan G. (QB Support)

Dan G. (QB Support), Official Rep

  • 490 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Dan G. (QB Support)

Dan G. (QB Support), Official Rep

  • 490 Points 250 badge 2x thumb

Comment posted by:

Glad to hear you got it working. You should post your good formula in the answer in case other people have the same issue.