Get data from reusable element

I’ll get straight to the point - I have a reusable element that is a journal where a user can input some text and an image
On the same page with the reusable element I have a seperate floating group that has the save button, how do I get the data from the reusable element to be available for the save button? I can’t find any solutions, thankyou.

1 Like

Custom states

https://manual.bubble.io/help-guides/structuring-an-application/custom-states

I know about custom states, i’ve thought about how to make it work with those but I don’t understand how its possible.

Inside the reusable element, you’re going to need to run a workflow (on click, on page load, when condition is true, it doesn’t matter). In that workflow you run the action “Set State”. You then set the state to the custom state of the reusable element value you want. Then in the floating group you use the custom state from the reusable element.

1 Like

That makes sense and I understand, but I don’t really see when I’m going to run that workflow needed to set the state. As stated, the save button is not inside the reusable element, and I should add that users can decide to fill in what they want on the inputs, nothing is mandatory. So im not sure how im going to be able to run this workflow.

You want the workflow action on the reusable element to be a custom workflow action that has the step of setting the custom state. Then when you put the reusable element onto the page and want to run the workflow to set the state, you can trigger the custom workflow from a reusable element.

Alternatively, if the custom state is on the reusable element itself, you can simply run a workflow to set that custom state, like you would any other custom state.

1 Like

I’ve got this state, but when I try to use the state as a data source in another group the reusable element doesn’t show as an option.

bump! Someone lmk if its even possible soon please because I’ll just have to go back to using less reusable elements, I would rather do that than delaying things anymore. Thanks.

bump.

I have the same difficulty. It’s weird that Bubble doesn’t offer direct access to the input fields of reusable elements contained in a form. Direct or through the call of the element, for example: Data Field = ReuseElt’s Input_Field_1

Anyway, I ended up by usong a state, but only because I only need to retrieve a text value. If I had to transfer the values of tens of fields of various types, I would have given up.

Here is the process:
1/ create a StInputData state at the reusable element level
2/ create a WF of type “Elements > an input value is changed” at the level of the reusable element, with a “Set state” step, with StInputData = Input_Field_1
3/ at the level of the page containing the reusable element, in the recording WF, I call the state StInputData of the reusable element

Each time the user inputs some text, th estate is updated, and accessible by the page.

Hoping it will help you.

This topic was automatically closed after 70 days. New replies are no longer allowed.