☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Get button state from on_click, on_change outside of the callback

Community Support
bonobo2000
bonobo2000

hey there,

I have a bunch of buttons defining the value of a variable, that I want to use as a parameter to an sql query. So if button state is equal 2019, the query will set the value of a variable to 2019.

If I understand correctly, I can run my query within the callback function that I pass to the on_click or on_event. The new argument would capture that. I was wondering if there is a way to get these values returned, so that I could run my query outside of the callback function. For example, by accessing the myobj._property_values["active"]…

thanks in advance…

⌁   Link to post
Bryan
Bryan

As long as the objects are in some accessible scope, you can just reference them like any Python variable. See e.g. the callback referencing all the sliders here:

⌁   Link to post

End of archived discussion · Replies are disabled