Need help accessing data that is in a Reusable Element that is inside a Repeating group

So.. I have a Repeating group in my page and each cell contains a Reusable Element. How can I do to get a piece of information when an action occurrs within the Reusable?

Unfortunately, orchestra plugin wont cut it since musicians and maestro are not in the same page and also URL params are not enough.

Simple…

Add a JavaScriptToBubble element on your main page (set to publish a value, of the correct type).

Then inside your reusable element, when the action occurs, just call that JS2Bubble element using a Run Javascript action and pass the relevant data into it.

Ohhh man thanks a lot, never thought if it!

I’m a non-technical bubbler and tried this method with partial success. Any insights or tutorials you / anyone else could point me to would be much appreciated.

I’ve a reusable element in a repeating group with a yes/no state thats triggered when input within that element’s value changes. I need that yes/no in that reusable element to register on the main page so as to trigger other actions down the line. I setup a TEXT element along with the JS2Bubble element on the main page. Tho it clicks through without errors I can’t seem to get the yes/no to show up in the text element or anywhere else? Again, not being technical, I think I’m missing something fundamental in the setup. Best-

Set the value as is a list on the JS2B element, and clear the output1/output2 fields on it, you don’t need those.

On your run javascript it would look like this:

bubble_fn_trigger(properties.param1, properties.param2);

Then in your main page, create a new workflow where the event is javascriptToBubble event. Then you can use this javascript to bubble’s value list’s item X’s yes/no.

I’d also recommend not making the suffix ā€˜trigger’ and instead something a bit more descriptive and specific, because these functions must be unique on the page. So if you added another one, you couldn’t call it trigger again, maybe trigger_two, but that’s not really best practice.

No joy… Just want to be clear. I only need ONE Java Script Element and it goes on the Main page and NOT inside the reusable element residing in the repeating group on the main page? However I’ll need TWO workflows, one within reusable element triggered by a change of an inputs value and the second on the Main page?

Could you share more information? It’s a bit confusing understanding what you are working with. Some screenshots of your current workflow in the reusable would be helpful.

If I understand correct, you have a main page with a repeating group, inside each repeating group cell there is a reusable element with a state for yes/no. You want so if any RG’s cell’s reusable’s becomes yes/no then trigger something on the main page?

What is the input type on the reusable? That sets yes/no. And that yes/no is being saved to a state on the reusable?

You nailed it. Thats exactly what I’m trying to do. When the user changes a value(s) a workflow begins with JS2B ā€œYESā€ does a couple of things then end with JS2B ā€œNOā€.

Maybe it doesn’t need to be a YES/NO? I suppose it could also be Arbitrary text YES or Arbitrary text NO?

I’ve tried many iterations and setup several different ways to capture the result. They click through without error but nothing resisters yes or no…

That’s a little confusing.

If you want to pass values to the JavaScript to bubble, they don’t go into properties.param1 or param2. They have to go into other fields… either in return, or in output1 or output2…

The Toolbox documentation makes this clear:

I put together a quick example here so you can understand. Don’t worry about the data type or anything like that—just focus on the logic I’ve implemented. I have a JavaScript to Bubble on the page, a repeating group, and a reusable in the cell. Inside the reusable, I have a dropdown that runs the javascript. I think this will help you understand better:

I really appreciate the effort. But I have to say nothing about that docs was clear. I just need a reusable element to transmit YES or NO to the page in-which the repeating group resides. Why is that so hard for bubble to do? Yes… or No. Bubble drives me madd with this stuff sometimes. :man_facepalming:

I’ll just have to think of some other workaround - again!

Did you see my example? In addition to the link to the toolbox documentation, I included an example similar to what you’re trying to do.

Yeah bubble can be annoying. I made a demo page for you. It’s simple and explains exactly how to achieve this. I promise once it clicks, you’ll be shocked how powerful it is.

https://brandarrow.bubbleapps.io/version-test/demo_page

Let me know if you need any help understanding it!

Sorry to say, I keep getting an error: ā€œBug in custom code ReferenceError: bubble_fn_shuffletrigger_yes is not definedā€.
Question about your example: Why is the cells index important?

To be clear any one of the elements in the repeating group can can trigger the ā€œYES/NOā€ It’s doesn’t need to be specific to just one.

Two things that are different from the others examples I’ve tried.

  1. You put the JS element in the repeating group NOT just somewhere on the page.
  2. The reusable element is included in the suffix

I’ve tried about 37 variations, derivations and guesses that all end up with the same reference error. I simply can’t believe I’m having this much difficulty in getting this thing to register a simple yes or no.

Ah okay, if you don’t care to track per repeating group item, and want to track in general. That makes it a bit easier. Again, I updated the demo for this. Just look at it.

If you follow the structure of the demo editor, and reusable you’ll be able to get it setup in 5 minutes.

Bug in custom code ReferenceError: bubble_fn_shuffletrigger_yes is not defined

This part means that your JS to Bubble event isn’t visible on the page, ensure that it’s visible on page load and in the input field you are using just the suffix not the entire so.

Thanks, again, @parthapatel0723 I’ve been off in other directions. I’ll loop back around to this next week. Maybe some time away will help?