Let’s err, forget we ever had this discussion!
Ran into two frustrating limitations:
1) One of my properties is a List – But the list is within a RG… And so I cannot choose the list in the dropdown for Dynamic Value (I was hoping to pass a list of data I already have available to my reusable… nope, guess it’s back to custom state)
Screen 1: I have a RG on my page for Time Entries (list)
Screen 2: When pulling down the Dynamic Value field for “Time” (which is of type Time Entries), it isn’t there. sigh
2) You cannot pass data via a workflow - I was thinking in the “Display Data” we’d see the properties to dynamically add… Nope.
Screen 1: I have a Property for Time (a list)
Screen 2: When I display data to the Reusable, I cannot see a place to put my list
Back to custom states for me. Ugh.
Update: Moved this to a custom state… and it works perfect - Allows me to pass in the RG perfectly fine. I’m going to guess it has something to do with the fact the property is on the page level (so if I have a data source in a RG with 4 rows, I’ll technically have 4 data sources… so the RE wouldn’t know which data source I’m referring to).
Expected behaviour
Guys, how do I display data on 2nd or 3rd property of a reusable from inside ?
Same way you display the first property, no? What do you see in the dynamic data drop down?
Only , the initial property
Pure gold, what we really need is dynamic custom state. @kate.mcnally
Is it me who overworked and can’t find obvious things lying on the surface or there is really no way to check where RE property is used (via App Search Tool or element inspector of the RE)?
I just discovered this feature a few minutes ago and holy shnikey…how did I not know about this sooner! Would have saved me SO much time banging my head against the wall trying to figure out how to efficiently pass data into a reusable element in my repeating groups.
LOL I was wondering the same thing - I didn’t even see the button!
Bubble, can you please add the ability to debug dynamic properties in the debugger? In the debugger, dynamic properties show up as static values. Below is a screenshot showing all the values in the debugger:
But here is a screenshot showing how pretty much all of those values are dynamic:
Thanks MattN, this got me started.
I have here an implementation of receiving events / event triggers from a reusable element.
My case is a reusable element that shows a list of recent searches for a user. When the user selects on of their recent searches (to invoke that search again), the page is notified of the change in the reusable.
First, create a reusable and add a custom state on the reusable element to capture your return value.
Second, assign a value to the custom state when the action occurs:
Third, reference the value of the custom state as an optional property’s default value on the reusable element.
Notice my use of the old-school programmers terms of “Get” and “Set”. From the perspective outside the reusable, I am setting a value to be used by the internals of the reusable element. When I want to read what is being returned by the reusable element, I am getting a value from the reusable element.
Fourth, I use a “when something is true” checking for the value of the Get Selected Location = not empty for all occurrences. This event is only true when something inside the reusable element sets that custom state, which then is available to the Get Selected Location property.
Fifth, notice that inside the workflow that responds sets the value of the custom state back to blank.
This flow MIGHT work without the Get Selected State property, just looking at the value of the custom state.
I am hoping that Bubble will support the next step of supporting properties.
- Could be like an event that fires when a property’s value changes or allow the Default Value to see more objects inside the reusable element, or better still
- Being able to set the value of a reusable element’s property. Like this:
Nice one Paul!
Indeed you don’t even need the ‘Get Selected State’ property - you can just read the custom state or the RU from the parent module.
I usually use custom states as the output and properties as the input to keep things clean in these kind of ‘event-based’ patterns.
The other thing to make the RU even more modular is to keep the ‘reset custom state’ action inside the RU itself. I did a Youtube tutorial on this recently if it’s helpful!
I don’t see any way to access the property in the workflows of the re-usable element. I’m trying to trigger workflows using the properties but see nothing there suggesting it is usable in workflows.
Could you please suggest?
You can’t access events outside of the reusable and you cant use display data in a reusable elements other properties inside a reusable ( only main data source ) .What you can do for former is to change states using a connector element reusable1 - connector (group,button) - resuble2 and trigger the states.For the latter you can assign dynamic values to property of a reusable that is inside of a reusable and when inside clicked change the inside groups value thus reusables other property values will change .
Hi,
Just my 2 cents about the fact that the Bubble Doc clearly states we can use the properties to pass data “to AND FROM” the RE.
In reality, we can NOT pass data FROM the RE to the exterior.
Documentation : Reusable Elements | Bubble Docs
What do you mean by that?
Of course you can pass data out of the RE using properties (although you’ve always been able to do that with Custom States anyway… so nothing much has changed there).
How? I’ve only been able to set properties from outside the RE.
You can set them from inside the RE using the ‘Default value’.