Ascending/descending order of repeating group element

I have a repeating group cell that is displaying a movie ratings.
Right now the repeating group loads the cell with the current users ratings so the order is not sorted.
I have a text above the cell that reads
‘Star Ratings’
When that’s clicked I want the ratings to sort
From 10-1
When clicked a second time, I want the ratings to sort from 1 – 10

Any help would be great

Use custom state as yes/no. Set state based on text click. In RG use change which field for sort, for descending reference the custom state.

That worked! Thank you