I was wondering if there's a way to conditionally set the background color of a button based on a selected row value. I'd like to use the button color as a visual indicator of status for a work item. So, if the value of the given item is In Progress, then the button color should be yellow, if it's Completed then Green. This is a visual cue to the user, they can then press the button to call an API and switch the status between the two....
Hey @gilcrest! There’s no way to do this in Retool natively currently, unfortunately. You might be able to hack around with custom css. This is definitely a good idea, so I’d encourage you to post about it in #feature-requests and tell us a bit more about what you’d want to see!
@gilcrest Looks like I spoke too soon! You actually can write Javascript in curly braces to dynamically set the button color in that custom background color area. It doesn’t look like it works (no preview) but it does. So you could write something like this that would make the button red if an order is suspended:
Ok, awesome!! - thanks a lot - I just assumed it wasn't going to work as I didn't get the preview/UI formatting/highlighting you all are talking about, so I went no further - I'm going to try right now