I am working on a repeating group with images / and an overlay for each image. When you click on an image the overlay for that image appears, see example below. The problem I’m trying to solve is that I would like there to be a maximum of one overlay visible at any one time. This would mean if one overlay is visible and the user clicks on a second image, the overlay for the first image is hidden, and the overlay for the second image is shown.
I’m really struggling to find a way for two different elements within a repeating groups to interact in this way.
The only thought I had was if I could get a custom state to trigger a workflow - is this possible?
Hi, you are on the right track with the custom state. Create a custom state of type number and call it say ‘showOverlay’. When you click on the image run a workflow to set the state’s value to the current cell’s index.
On your overlay element, create a condition that says when showOverlay’s value is current cell’s index then this element is visible.
That will hide the previously clicked images overlay when it shows the new one.