Ah yes good point. Though, to actually set it (e.g when button is clicked) you need another group and display data in group and use that as the source, so kind of the same level of workaround as passing custom states.
Is there anything to keep in mind when using the Dynamic field with an expression? Does it evaluate in the same way that any other Bubble element does? I realized that the dynamic expression can refer to other Reusable Element Properties – it’s ok to use, correct? Or should I keep something in mind when doing that?
I have setup some of my searches as a RE property on my header…and then an additional property that refers to the previous property, only :filtered. I haven’t had any issues using it that way, to-date.
Hi
Awesome feature !
I have a reusable element which contains an icon.
I need to change the icon regarding the context the reusable element is used.
How to manage this ? It seems we cant have a property of an icon type.
Is there a workaround ?
Many thanks
I’m assuming you’re speaking of Bubble’s native icon? In that case you would have some sort of mapping table that takes in a string and you then have to manually the conditional on the icon element.
Some other icon libraries give you the possibility to pass a string value, but you can’t do that with Bubble’s native.
Is there anything I need to keep in mind when working with expressions inside the default value
? Do they just update as expected or are there any quirks to how that expression is evaluated?
In the below case, the Current level will auto update whenever any of the underlying conditions change?
I’ve been working in this way for a while but I always have a spidey sense that these expressions evaluate differently, but I’m not sure.
Thanks
I ended up with an html element in my reusable element instead of an icon.
The html element display an icon I got from a linked svg. (for example I use the UUI icon library here : 1,100+ FREE SVG icons | Untitled UI Icons).
Continuing on my previous musing, there’s no this
object in queries inside of RUE’s properties.
While that exists in a normal element
Video of RUE’s property field, aka “wrong behavior” : CleanShot 2024-10-10 at 15.36.44 · CleanShot Cloud
Video of expected behavior: CleanShot 2024-10-10 at 15.37.49 · CleanShot Cloud
Nice. Are you uploading each icon individually?
Here is another solution using Material Icons. You would just create a text property on your reusable then pass that into the icon.
Indeed every Icon has to be set up individually.
But it’s fine.
Thanks for the tips I will look at it !
To get around that, try putting a group in the RE and have the expression for datasource as you need it, then put the property default value equal to the groups value…but yeah, there should be a ‘this thing’ as part of the expression for property as well
Does Bubble have any plans to allow us to set properties in the near future? I feel like the use cases of just using a default value are far and few compared to the use cases of being able to set them from events.
I do something like this:
- say we have a reusable called
shopping cart
- it has a state, let’s call it
cart total
. - have a property where the default is the value of
cart total
.
Outside of the reusable you can have an action that set’s the state of shopping cart
’s cart total
.
It’s been 0 days
since I shot myself in the foot by forgetting to “save” on the reusable properties.
Is there any other place in the Bubble interface where you have to hit “save” after changing an expression?
Yes, workflow triggers that take on value