Sure, it’s quite a specific (and seemingly simple) thing, but in Bubble it requires a few workarounds… (in any case I’ve got it working perfectly now so it’s no longer an issue)…
I have a repeating group, with another repeating group inside it and, on a particular action (specifically when a video is loaded into a Vimeo player, triggered by a Vimeo SDK event listener), I need to trigger a particular action inside a specific cell of a RG nested inside a specific cell of another Parent RG.
There’s no way to do that natively in Bubble, so I’m using the Orchestra plugin to be able to reference the specific cell inside the nested RG.
That’s simple enough and it all works fine when everything (including the second RGs) is visible on pageload.
But due to the fact the the nested RGs are hidden on pageload until the Vimeo SDK event listener triggers them to show and the way the Orchestra plugin works, the Orchestra element that needs to be ‘revealed’ before I can access the elements within the nested RG cell is not active when that event triggers (mainly due to the delay between the element being shown, and it actually being visible - made worse by the fact that I’m using animation to show the element).
(Without the issue of the animation delay, I could probably just use 2 custom events to ensure things happen in sequence, but as the animation happens after the element is visible, the workflow thinks the first event has completed (which it has) so tries to run the next event (when the Orchestra element hasn’t been ‘revealed’ yet as the element is still being animated), which is what’s causing the problem. I could just not bother with the animation - but it’s part of the UX/UI so I want to keep it).
If I run the second part of the workflow immediately, it’s too quick to catch Orchestra element inside the nested RG cell and the plugin returns an error.
The obvious workaround is to schedule a custom event on a time delay (500-1000ms), but that’s a bit hit-and-miss - too short and it doesn’t always work, and too long and it slows the action down unnecessarily - plus I don’t like like leaving things to chance, I’d rather know for sure that the first action is complete.
So, ideally, when the initial action is triggered (via the Vimeo SDK event listener) I could then wait until the Orchestra element inside the nested RG cell is ‘revealed’ and therefore available to the next step of the workflow (by setting a custom state once the plugin element is revealed) and then run the final action when that custom state value is true, that way always being 100% sure that the first action (the activation of the plugin element) has been complete, before attempting to run the next workflow action.
As it happens, I’ve managed to get it working perfectly using @austin3’s suggestion of setting 2 states (1 being a list of the nested RG’s cells who’s Orchestra plugin elements have been revealed) and running a ‘do when condition is true’ event when both are met (basically flipping the problem around and approaching it inside-out so to speak).
It seems to be running with 100% accuracy and is pretty fast - so I’m happy with the result - but a simple ‘wait until condition is true’ workflow action would have saved a few more complicated steps.