Conditional alert

The end user wants a conditional alert. Does retool have a way to do this?

APPROACH1 : define a variable status and run a javascript query

If (status=="RED") {
do_something
}

APPROACH 2: create a component like this
image

and I see in that component event handlers like RUN ONLY where I can specifiy a boolean condition such as {status=="RED"} Could I use that to have the alert only display when the boolean is true? or does that condition need to be in another component which controls this component?

Ideally an alert would popup which the user would have to clear. Alternatively, an indicator could turn from green to red

@lee_walter You can use utils.showNotifications() and put the condition in there
https://docs.retool.com/docs/scripting-retool#utilsshownotification-title-string-description-string-notificationtype-string-duration-number-

1 Like

Thanks, @ScottR . Very helpful