How to pass data from main page, to a reusable element that sits inside of a repeating group?

Merry Christmas Eve,

You guys know me. Social Media App guy.

The home page filled with “posts” on my app is simply a repeating group that has a reusable element that displays the actual post and accompanying comment section.

My question to you, is, when users leave a comment, I use URL parameters to give the users a floating comment box. This floating group is on the main page.

When users submit their comments, how do I alert the post that sits inside of the reusable element that sits inside of the repeating group?

Is that even possible? Rn I’m using a mixture of the satellite element along with a “generate_random_number” plug-in that essentially gives a unique Element ID to each reusable within the repeating group.

The satellite plug-in pretty much sends out a mass call to action that triggers any antenna within the reusable within the rg, only as long as that antenna has the same Element ID as the ID in my URL.

(The ID in the URL is a combination of that random number plug-in and it’s effectively generated whether a user clicks on a comment icon. The comment icon is inside of the reusable that is inside of the rg, so this comment icon knows what the random number is already.)

You see? The system I have is too convoluted!

If the comment is associated with a post, it just makes sense to put it inside the post RE. Then, when comment icon is clicked, show that comment popup/floating group/whatever and you know the relevant post from the RE data source.

1 Like

I agree. I don’t understand why you need any plugins or special IDs. Every post is already unique.

If that’s the case, then perhaps you should reverse your thinking and instead of passing the comment to the post, just pass the post itself in the URL and then implement the logic to save the comment at the page level.

Better yet, make the floating comment box a reusable. Even if you don’t use it elsewhere in the app, encapsulating the comment save logic will make your app more modular and maintainable.

Unless I’m missing something, this issue can be resolved with simple pure Bubble techniques. There should be no need for any plugins - and especially not the Toolbox plugin or any JS. (Please don’t force me to call the no-code police. :smirk:)

 
 
p.s. If you did need to generate a random id for some reason (which you don’t need to do for the scenario you describe), why not use Bubble’s built-in random string generator expression instead of a plugin?

1 Like

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