Dynamic data from a Bubble.io plugin’s click events

I’ve spent a bit of time figuring out how to get a click event from a plugin to be accessible as Dynamic data and was able to thanks to some of the posts here! I’ve put that knowledge into a tutorial and I hope it can help another fellow Bubbler! Dynamic data from a Bubble.io plugin’s click events: Dynamic data from a Bubble.io plugin’s click events | by Jason Yee | JavaScript in Plain English

bubbleio-publishstate.mov-hq

The gist is to add the instance to the window object. That allows you to call window.instance.publishState(‘EXPOSED_STATE’, var_used_to_create_button_dom_obj) in a button’s onclick event.

Very helpful posts:

1 Like

Not helpful. Not correct. Thanks for playing.

What is up with the random “I am running the javascripts” clowns tonight?

I’m happy to follow the docs that shows how to accomplish this (see links to app & plugin below), and some pointers on how this approach is incorrect. Can you pls share?

Otherwise, some additional context is that this was done to ship it for the purposes of a demo vs. a prod app. In that sense, is doesn’t need to be “correct” which I interpret as being secure, perfectly architectured, or done most elegantly.