Reset states in repeating group

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!

Hey @johndurso ,

I might be completely missing something here but it seems like if there’s information in a state that you don’t want to be there, you should simply set the state to blank:

So when the user clicks to go back to a different project you would set the state to blank and it would remove the information from that state.

Best,
Alex
dowcoaching.com


Helping entrepreneurs build their app through 1 on 1 coaching and asynchronous videos

@bubblealex The issue is that the custom state is inside each cell of the RG, so how would I reset the state in each cell? What you’re showing is possible if the custom state is on an element outside the RG, but you can’t set state of an element in a RG from a workflow triggered outside the cell, which is my issue.

@johndurso Gotcha! I use this plugin myself to access data inside a repeatinggroup: New free plugin (9 march/20) - Orchestra! Refer to inside repeating groups cell(s) from outside - #114 by Arzy

Best,
Alex
dowcoaching.com


Helping entrepreneurs build their app through 1 on 1 coaching and asynchronous videos

1 Like

Thanks Alex, I was able to use it to accomplish this. Was hoping I wouldn’t have to use a plugin, but at least I got it done!

1 Like

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