Passing Data to Page from Reusable Element in Repeating Group - Seeking Optimal Solution 😕

Hi everyone,

I hope you are doing well. I’ve been working on a project recently and encountered a challenge that I need your help with. I have a reusable element in my app that I want to use within a repeating group, and I need to pass data from this reusable element to the page it resides in.

I’ve spent a considerable amount of time researching and experimenting with various solutions. I tried using the "Satellite " plugin, but unfortunately, it didn’t work as expected with repeating groups, and I encountered numerous bugs. I’ve also tested several other scenarios, but each one seems to have issues when dealing with repeating groups.

To give you a better idea, here are some of the challenges and scenarios I encountered:

  1. Satellite Plugin: I tried using the "Satellite " plugin, but it didn’t work well with repeating groups, and I faced issues with data synchronization and handling events.
  2. Passing Data: I attempted to pass data using custom states, but this resulted in inconsistency and difficulties when updating the elements within the repeating group.
  3. Workarounds: I even tried various workarounds like using URL parameters and using unique IDs for each element, but these approaches proved to be error-prone and inefficient.

I’m reaching out to you all because I believe there must be an optimal solution or best practice to handle this situation efficiently. I’m looking for suggestions, ideas, or any insights on how to pass data from a reusable element within a repeating group effectively.

If any of you have faced similar challenges or have experience in dealing with this kind of scenario, I’d greatly appreciate your guidance. I want to find the best approach to handle this problem in the most time-efficient manner.

Thank you all for your time and expertise. I’m eager to hear your thoughts and recommendations.

Best regards, amer

2 Likes

Personally, I think the simplest way to do this type of thing is just with a JavaScript to Bubble element. It’s how I do it.

Put the JavaScript to Bubble element on the page, set it to publish a value of the relevant type, then in the RE just use a run JavaScript action to call the element as a function and pass the relevant data into it.

6 Likes

Thank you @adamhholmes for your suggestion! I appreciate your insight on using JavaScript to Bubble elements. I’ll definitely give it a try and implement your approach. Grateful for your help!

2 Likes

I am encountering this issue too and it seems like your solution may work. I don’t know too much about javascript - any chance you have an example you could share so I can see how this works?

@calicass83 Sure…

Here’s a simple example of passing a value from a nested Reusable Element to a JavaScript To Bubble element on the main page, avoiding the need to use custom states and only when conditions through multiple layers of nesting, or an additional plugins.

Just have the JS to Bubble element on the page, and in the nested RE run a Javascript action to call the function and pass the relevant data to it.

Data From RE With JavaScript (bubbleapps.io)

2 Likes

There are one or two pages in that app :stuck_out_tongue:

1 Like

Thank you for this solution, it’s excellent! I was going crazy with all the custom states and only-when workflows.

1 Like

Would this // how would this work in reverse?

Is that possible? Trying to pass data from the main page, to a reusable that sits inside of a repeating group?

Should work just the same… (as long as each instance of the JavaScript to bubble element has a unique function name)