Initialising State Variables

I use a state variable in a group that is part of a repeating group.

As the state is local to an instance of the sub group in the repeating group I cant figure out how to reset the state variable on all instances when the repeating group is closed (slid out), then repopulated.

any luck with this?