Set state of other reusable element?

Hi! How can I set state of one element from other element? Is there anyway to do this without using BDK Env? Or any other free plugin for this?

If you want to set the custom state from one element on a page to another element on the page, I would just set both custom states at the same time to the same value…if you really need it to be that element 1 has custom state 1 and element 2 has custom state equal to element 1 custom state 1 then you would in your workflow set the custom state of element 2 to a value of “element1scustomstate1svalue”

If however, you are trying to do what your title is implying, setting the custom state of one reusable element to the same as the custom state of another reusable element, then you need to find a creative way to set it once they are on the page together.

If you share more information about what you are trying to accomplish it would make assisting possible as there are way to many use cases to go through how to make each work.

Share your use case, some screen shots of set up and any other relevant information and I could share my thoughts on how to get them to “talk to each other”

I purchased the BDK plugin and wish I hadn’t. Not that it isn’t very robust, but I found a way to have the same functionality without it, and my purchase decision was based on a thought that all the plugins on the BDK plugin page were part of the $16 purchase, so I thought I was getting 20 tools instead of 1.

Same sentiments here. Not ready to buy BDK Env since I’m still on a hobby plan and still exploring/learning bubble.

My use case would be a patients card from a reusable element and when clicked, i want to set state of the “view” of another reusable element and then display data of the clicked element to that reusable element.

It goes like this.
I have “customer page” and “events page” reusable element.
Inside events page, I have another “customer cards” reusable element.
When I click on the customer card, I want to set the state of the customer page from “customersearch” to “customerprofile” then set state of the customerprofile to match the customer card I clicked.

A couple of things first to consider. If you are dealing with patients ( ie: medical patients ) bubble is not HIPPA compliant and so your application wouldn’t have the necessary safety precautions to operate within the medical field and store medical patient data. Search on the forum about HIPPA compliance and the implications it poses for apps built on bubble.

To your question about passing data…I would suggest you put the “events page” reusable element into the “customer page” reusable element so that you could set it up the way you want with the multiple clicks.

However, if you must keep them as two separate reusable elements I think your only option to accomplish what you described is using the plugin.

Another thing to consider is your set up. It sounds like you want to have a search for customers or patients. From the search results ( which should be displayed in a R.G. ) the app user can click on a patient name and have this data sent to a patient profile page.

I personally wouldn’t bother with reusable elements for this and instead just have pages. That way you can easily send data between the pages. If you really want it to be on the same page, where a set of search results in R.G. for patients is on a page and when clicked there is another group that shows the patient data ( probably with more details ) then I would just use one page with separate groups.

Reusable elements are good in my opinion for a couple of things at two opposite sides of a spectrum. One reason they are useful are for small components like yes/no sliders.

yes_no%20(1)

Using reusable elements like this across the app is easy and straight forward.

Another use is for large components that are used on a complex page. Some people build what they dub “one page app” which when building lots of complex components starts to slow down the editor and makes the building phase much slower.

From what you describe, it doesn’t sound to me like you are building a one page app, nor does that pages you mentioned sound like complex pages.

So, ultimately I would save myself the hassle of trying figure out how to solve the problem ( which seems like buying the plugin ) and instead try one of the two approaches I mentioned ( 1. two pages or 2. two groups on one page )

On my app I have lots of different business types, like brick and mortar, delivery, ancillary etc…each of these types of businesses have at one point a need to be searched, so I have a search page for each type of business. Each business also needs a profile page, so I have business listing pages for each type of business. I simply pass the data from the search results page to the business listing page.

1 Like

Hi,

@boston85719 provided some very useful info. Just wanted to put my two cents in:

Let’s say you have REU1 and REU2. There are two ways of accomplishing what you’re requesting with “vanilla” Bubble.

  1. You’re referring to setting the state within REU1 to REU2, I would suggest an easier approach if you your data type is not occupied:

Kazam_screenshot_00135

  • Make both REU’s the same “type of content”.
  • Put both on the page
  • Make REU2 to be REU1’s value

REU2 will automatically update.


IF you absolutely need to keep the “type of content” open for something else, and need to use states, you can do a “do every time” (at the page level, when you already have both REU’s on the page)

Kazam_screenshot_00138

Disclosure, this works 99% of the time, but if data intensive or your user clicks on other things fast it may not update. Bubble’s listeners aren’t bulletproof.

This setup only works one-way - i.e.: if only REU1 can change the user. if you need two-way, let me know there’s also a setup for that.

3 Likes

How do we mark this a solution?

I only get these choices

01%20PM

Thank you! Just trying to make it for a mvp/prototype but I don’t intend to use it for long run. Still gonna have someone to hardcode it for us for more protection if this goes well. Also, we are from Asia and still not bounded by hippa.

Thank you both of you for the answers. Will try both of your answer. :grin:

Sorry but it didn’t work. Because the reusable element to be clicked is inside a repeating group inside a reusable element. The two elements is not inside the same page. (This is one page app.) Maybe my last option is to use env I think.

As of the moment, I just use a workaround that is not useful later on.
When the reusable element is clicked, go to page app with param. Then have a condition, do when param is not empty, display data in, do a search for thing with constraint of the clicked element’s unique ID.

If that is true, then you should create a reusable element to be clicked with a custom state of a data type equal to the type of data that the repeating group it sits in is. Have a workflow that says set custom state to parent groups thing ( which is of same data type )

Then put that reusable element into the repeating group in the other reusable element.

Play around with those ideas enough and you’ll get it figured out…might take a while put you could stumble upon other thoughts of your own of how to solve it.

You have to be OP to mark as solution.

This may make it difficult, but you can use query parameters to send data that way. If you show a diagram of your setup or a copy of your app we can help.

For the moment, url param works and do a search function. Thanks to both of you. :slight_smile:

1 Like

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