Resetting Repeating Group Within Popup

I have a popup that contains a repeating group. Within the RG, I have 2 additional groups, MinistryTitle (contains Title and Button to display more details) and MinistryDetails (contains details and button to view serving opportunities). See below for screen shot.

Ministry Details Group is hidden and collapsed by default. When the user clicks on the “More Details” button, the MinistryDetails view is toggled on/off. This all works great. The problem that I am having is when the user closes the popup and reopens the popup. When this happens the MinistryDetails group is still open.

When the user clicks on the close button, the MinistryDetails should be hidden and close the popup. However when I try to add a hide the MinistryDetails group, it is not available as an option. I would assume this is because the MinistryDetails group is part of a repeating group and does not know which one to close. Is there another way around this?

@jasonh

Please, have you tried this action after closing or before opening the popup?

https://manual.bubble.io/core-resources/actions/element#reset-a-group-popup

Yes, I tried the reset of the group before closing the popup and that does not work.

@jasonh

Resetting a group deals with data. I think you want to manage visibility right?

If so, then it would be better to set your visibility actions/conditions and even data-setting ones when you are first opening the popup rather than at closing it. Sort of like “front loading” your logic when a popup is opened.

For visibility I suggest that you explore how custom states work. It should provide you with more control than using visibility actions. :grinning:

@jasonh

Your solution seems to be perfect, but since it’s not working according to your needs, a possible workaround would be to create a custom state with the same type of MinistryDetails.

After clicking the More Details button, you enter the selected MinistryDetails in this custom state, and in the Repeating Group you set to displays the MinistryDetails that were entered in this custom state.

By closing the popup, you remove the custom state value.

Please, let me know if this helped you!

I normally control the visibility using a custom state for the groups. I have tried the following:

  1. When clicking the “More Details” button, I changed the state of the DetailsGroupOpen=1. However, when I try to change the state back to 0 when the close button is clicked, the Details Group is not available as an option.

  2. I then tried adding the state value to the repeating group. This did hide on closing the popup but when clicking the “More Details” button, it opened all of the DetailsGroups within the Repeating Group.

What I ended up doing is setting the open value of the repeating group = the cell’s unique id and then set a condition to show the DetailsGroup when the RGOpen=current cells unique id. This prevented all of the cells from opening and allows me to clear the open state.

Thanks for your help.

3 Likes

Perfect! Thanks for sharing your solution!

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