I have a RG that shows a list of products with their info and allows the user to scroll back and forth between revisions, where the revision is kept in a custom state in the cell of the repeating group. The initial state is to show the most recent revision:
This RG is in a reusable element on a Projects page, and on the Projects page the user selects a project from a list to view and can go back and forth to select and view other projects which all have this product list.
The issue is that if the user views one Project and scrolls back in revisions on a Product - say in cell 2 - and then goes back and selects another Project, the Product in cell 2 will show show a previous revision, because the custom state in that cell has not cleared.
Is there a way I can clear out the custom states on load, or when the RG becomes invisible (which happens when the user goes back to select another Project)?
Alternatively, I thought about creating a list custom state outside the RG that could be references from within the RG, but that would have to track both each Product AND its revision to show, so I’m not sure how I’d do that with a list. Could be two lists, but that seems like it would get screwed up if a Product was added or removes from the list by another user interacting with the data.
Seems like clearing custom states within a RG would be a common need; what am I missing? Any help is appreciated!