Using Custom States in a cell of a Repeating Groups

I’ve noticed there are issues using Custom States in a Repeating Group.

Case in Point: You have a Repeating Group that shows Contacts, and every cell has a hidden group that holds more details of the contact which is toggled (Shown/Hidden) when a user clicks on the contact name.

Now a user toggles index 1 to show the details.

Now imagine the Repeating Group gets updated because a new contact was added somewhere else, and a new contact takes place of the existing index which State is “Show”, the result will be that the new contact will show details, whereas the previous contact’s details will be hidden!

Is there a way to depend “Cell” Custom States based on the current cells “thing” rather than the current cells “index”?

Or maybe clear Custom States when a Repeating Group gets updated?

1 Like

You could have a Custom State which is a list of Contacts, and use that to trigger “Expanded Contacts”.

Not sure what you mean

It can work the same as way as a multi select “tag” element.

A custom state holds a list of Contacts, and is initially empty.

When the user clicks “Show” it adds the Current Cell’s contact to the custom state.

The repeating group cell elements use the Custom State to determine what to show. So if the Current Cell’s Contact is in the Custom State Contact List, then a) the details are shown b) the Show/Hide button is set to Hide.

On “Hide” you remove the Current Cells Contact from the list (easy now we have :minus)

1 Like

Brilliant!, thanks

1 Like

I have created a pattern on BuildingOnBubble for this.

1 Like

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