Expose ID attribute as dynamic data?

In order to target a specific element on a page would it be possible to add the ID attribute in the list of dynamic data to choose from?

3 Likes

@emmanuel a particular use case I can think of is to use it for localization. Instead of being dependent on a RGā€™s order to change elementsā€™language, you can refer the attribute ID. I want to be able to control the language of my landing pages apart from the actual app language.

Another use case will be to flag certain input elements for various reasons. For example, Iā€™m storing a Modified By field each time a user updates any from a particular set of input fields. When I can also store the updated elementā€™s Attribute ID, I can flag it using conditions to make clear to a user which field has been updated.

Bumping this thread. Am I missing something maybe? I thought this was a useful feature for the above reasons. Is it because the attribute ID is not something the Bubble team considers a permanent thing in the current form?

2 Likes

I guess this is not seen as a useful feature by other users. Iā€™m still wondering though how you would easily solve the field modified by issue without being able to target individual fields . Perhaps something for a new threadā€¦

This can be done. I believe you may have to go into the settings of your app to expose the ID field for each element. Then, youā€™ll be able to edit each elements ID so that you can quickly/easily reference it in JS, CSS, etc.

Not sure I fully understand. I assume you have to use custom js to be able to store the fields attribute? You can manipulate the attribute ID in the condition of the element, but you cannot refer to it from anywhere else.

My idea would be something along the lines of adding the attribute IDā€™s to an objectā€™s state as a list and then be able to store that list so it would give a list of actions that have happened to that object. It can be used for notifications or to visually change an input field (like a green border, a ā€˜newā€™ icon etc) Then on visiting that object, it would clear it for the next use. There are some potential issues, but that is the general idea.

I have a bunch of different users working on one particular object and it is not always clear what each user has been updating.

2 Likes

Iā€™m sorry. I misread your question. You can ignore my answer.

Iā€™m with you on this @vincent56. There are some things that bubble canā€™t do that I need to, as a workaround, target the attribute IDā€™s using javascript. It would be very nice if Things that did have an Attribute ID would expose a new ā€œstateā€ like you said, that we could dynamically pull from when trying to reference that object in javascript (instead of having to hardcode 28 unique attribute idā€™s in my case). Maybe the reason this post didnā€™t get much love was because others have been confused by what you meant / bubble is meant to be a no coding tool so a use case for making working with JS easier isnā€™t as compelling.

From my perspective, though, one of the things that makes bubble so compelling as a no code tool is that it has remained flexible enough to admit that it canā€™t completely replace code and exposes ways to overcome its own limitations. So Iā€™m all for getting Thing Attribute IDs dynamically available to me in code.

3 Likes

I need this feature because the plugin Iā€™m using only uses the ID Attribute, however the ID Attribute needs to be different for every elementā€¦ so I canā€™t manually add it. This remains a problem