I need to get some information from a repeating group that I’m sure has been an issue before.
It’s pretty simple but I’m sort of stumped. In the example shown below, I have a repeating group of Movies (each cell shown in pink), and in each movie there are actors who need their contracts uploaded.
Each cell of the repeating group has one nested RG for the actors (shown in blue).
When I click on the UPLOAD button from within the nested RG, I just need to capture the Index number of the cell within the Movies repeating group so I know which movie it’s attached to.
I can’t seem to figure out how to get FLYING’s, or MAMBO’s Index number by clicking anywhere in the nested group. Setting the state doesn’t give me options to access it that I can see.
I tried to mess around with Maestro/Musician but couldn’t get it to work because the instructions are pretty sparse. Don’t know if that would be even do the job.
Basically when I click on Phil Campain under FLYING I should get “Index 1”. If I click on Xavier Cook under MAMBO I should get “Index 3” and so on.
Any elegant ideas? I have a custom state ready to receive the information.
- Add an expression to your movie RG, where the expression’s value = current cell’s index.
- In your workflow on click of the actor cell, set value of the custom state to the expression.
It’s weird that the expression is available in the workflow but not the parent index. But I just tested this and it seemed to work.
Not sure where you are adding the expression? The Data Source of the Movie RG?
Just plonk it right into the movie RG like this:
My dark box line is the equivalent of your pink movie line. The expression just needs to be within that.
Perfect! Once you used the word ‘plonk’ it all made sense. This works perfectly and it’s smooth, creamy and tastes delicious.
Thanks so much for your help on this.
FYI, I solved this without any workflows (not necessarily a concern in your case):
(1) Add a text input to your parent RG
(2) On the text input, uncheck ‘visible on page load’ and set initial value to ‘Current Cell’s index’
(3) Reference the text input’s value in any of the parent RG’s child elements
Thanks Josh, great little hack. I ended up using an expression like @SerPounce suggested but I’ll keep your solution bookmarked.
This topic was automatically closed after 70 days. New replies are no longer allowed.