Pass state to reusable element

Hi there,

I’ve tried this a few times, to no avail.

On my Index page, I have a reusable element used 5 times, each named Reusable_Element_(insert A,B,C,D).

I’m trying to pass data from which element is clicked (either A,B,C,D…) and set state of the element which can pass what I want to show up.

Having trouble passing the data through to trigger the state of the element. Any suggestions would be greatly appreciated.

image

You can set the type of the content in the properties of the reusable and even add more properties.
image

Then, wherever you add this reusable, you can pass different values:
image

You can add more:
image

And inside the reusable, you can do whatever you want with these values. I just printed them as text.

See the full example here: Test for Forum 12 | Bubble Editor

2 Likes

That worked like a treat, and I learned something new. Thank you very much!

(Didn’t know about the property pass-through)

1 Like

Sorry I realise I didn’t implement properly.

How can I set the property value on a click? I can get the item to show, but I need it to work via a click.

Sorry this was for another thread :slight_smile:

You can create a custom state, set the data source as the custom state and on-click, change this custom state to whatever you want.

Sorry I’m not seeing how I can link the two.

I can set the properties to be related to my reusable element.
But I am not sure how I can transfer the click to be related back to the index reusable element.

Reusable Element A showing Property 1.
How can tie in a state to Element A and Property 1?

I put the example of the idea I explained here:

See the demo below. In this demo, the value that is passed to the reusable is a custom state in the page and the button just sets this custom state when clicked by getting the input value.
chrome_YsTRSRaiAD

This is the custom state on the page:

This custom state is passed as the data source to the reusable:
image

And finally, the button just sets the custom state by getting it from the input:

Check the same page please: Test for Forum 12 | Bubble Editor

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