Passing data from one RE to another

I have a RE that contains a table. Inside this table, there is another RE.

How can I transfer data from the second RE back to the first RE using Custom States? I can only manage to make it work in the reverse direction.

I have already set state to the second RE in the second RE.
But I can´t use the Do when condition is true and reference the second RE in the first RE.

Hi @Xtine.

You want to do something like:

(1) Parent Resuable element
(2) Child Reuseable element

To do this (what I’d do), is add a state inside (2) Child Element, and whenever that state changes in (2) Child Element, I would do something based off that inside the (1) Parent element (Do when condition is true, like “state is not empty”, or “state is yes”).

Yes! But I can’t accessing child’s state from the parent.

I can only access parent from the child.

You’d either create a custom trigger inside that child that you can activate from your parent, or set the child’s state to something and have your child do something when that state is set.

Reusable éléments now support adding custom parameters, which are more flexible than states. Basically, you can add multiple data sources. Alternatively, you can use URL parameters - they are accessible from anywhere!

Cheers :wave::smiley:

If you can access the parent’s state from the child, why not make all custom states in the parent (none in the child)–or even in on the page itself or in a container that’s a parent of the parent RE?

Because the action happens in the child, not in the parent. I can´t add all the workflows for the child in the parent.

Thats excatly what I am trying to achieve.

In my child I have a CS called “dummyTrigger”. It´s on the top level of the RE.

In my parent I can´t find my child RE, so I can´t say “Do when condition is true”

Download plugin called BNS - Global Custom States. Thank me later.

1 Like

Your problem is not with Reusable elements, it is with elements that are within a repeating group. It is known that elements within a repeating group are not accessible from outside of the repeating group, unless you use an approach to make them so. One approach is to use a free plugin called Orchestra, there is another approach to use the toolbox plugin and some javascript. You will find many discussions on the forum of this issue.

1 Like

Thanks. I have tried searching without finding the solution. I will look into the plugin and search some more.

I’d imagine you were searching about reusable elements passing values to each other and not about accessing values from elements within a repeating group from outside of the repeating group.

1 Like

You might want to look into URL parameters for this. You can set a URL parameter and give it a type of a “thing” you’ve created. Then, you can set the value as the unique ID of the thing.

Then when you “get” the data (when you access the data from the URL parameter) you can set the type as well. This way you can pass data between repeating groups or reusable éléments without plugins (I don’t recommend plugins for things like this, but yes they do work too)

1 Like

My head is a bit muddled, I apologize if I’m being unclear.

BUT, am I actually trying to access something that is OUTSIDE my repeating group?

The reusable element Table has a reusable element, Child (not a repeating group) inside the table cells.

Isn’t the Child inside the repeating group, and shouldn’t I be able to reach the content that way?

I use an external database, and when I’m in Child (the second RE), I update a specific record. Once this record is updated, I need to force my table to refresh without relying on the current time changing since the last registration or update. (it doesn’t do this automatically, and I don’t want a page refresh)

I haven’t introduced URL parameters yet. However, would I be able to retrieve a Custom State through URL parameters?

I have not used the table element, but my assumption is that it works much like a repeating group, and so is likely that you might not be able to access the elements inside of the table element from outside of the table element, which the parent reusable is outside of the table while the child reusable is inside of the table.

I started looking into this plugin. I must admit, I’m a bit slow, and I don’t know where to begin with using the Orchestra plugin. When I look at the original post, it seems to go way over my head. I don’t get it.

I feel like I’m fumbling in the dark. But I tried this without any luck :melting_face:
I added a Musician to the Child element (the reusable element with the edit form).
I also added a Maestro to the Parent element (the reusable element that contains a table).

But where do I go from here? I tried to initialize Musician when the update button is clicked and when Musician is revealed - set state on the child, and WHEN Maestro is finished - set state on the parent, but without any luck. You’re a pro @boston85719. I guess this is child´s play for you! :slightly_smiling_face:

Hey Christine,

For the month of August I have a promotion where I’m offering free 30 minute bubble coaching. If you’d like, I can hop on a call with you and show you how to do this via the plugin or URL parameters (there are two solutions to this problem, and admittedly it’s a little complicated / advanced).

If you’re interested you can send me an email at jonah@visioncode.io or book a call directly on our website: https://www.visioncode.io/hello

Wishing you the best,

I’m not sure…when I suggested it, I was under the impression you were using a repeating group and not a table element. I suggest reaching out to @jonah.deleseleuc and take him up on the offer. He is very knowledgeable and should be able to get you sorted.

1 Like

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