Sort repeating group by which cells contain visible elements

Hi there, is there some way to sort a repeating group by which elements are visible? I have certain actions that hide groups within a repeating group and I would like to organise the repeating group list in order of visible items…thanks :slight_smile: