Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

How to know which button fired the callback

I got several buttons. with index 1,2,3,4.
use pattern-matching ALL(not Match)
the inputs of the fired callback got the list of n_clicks of the four buttons.
How to know which button fired the callback.

Please take a look in the docs, more specifically in the section Determining which Input has fired with dash.callback_context.

But with the pattern-matching “ALL”, the value type of dash.callback_context.inputs or dash.callback_context.triggered is a list which contains the information of the four buttons.
Is there any way to know which button(which id or index like the pattern-matching “MATCH”) fired the callback?

callback_context.triggered should work, unless you are doing something else in the layout (like rewritting the buttons in a callback or something).

Would you mind sharing a minimal example?