Basic question: Setting field value from a button

I did it when I created the workflow for the button.

The action I chose on "When Button Is Clicked " was to “Set a State”.

I then created the state called Text of type “Text” right there. I attached it to the page (bit of an odd concept, but all variables/states need homes in Bubble). So that is why it is state Text (what I called it) of Swap (the name of the page).

The action on the button then moves the field A text into the variable/state.

This variable/state is now available to other elements or workflows.

So I just set up the Input B field to take this variable/state as a default (Initial Content).

I am sure you recognise the concept of individual “objects” having their own data. So a page can have a “state” of EditMode set to yes or no. Or a button can have a count of the number of clicks it has received.

But we also use the states as temporary variables for the page.

So here …

… I am using a state that is a list/array of things/objects to store a temporarily selected list. Each time the user checks a checkbox, that checkbox’s fruit object is added (:plus) to the list.