When are the entries created for the repeating group? Usually you would do it then. Otherwise maybe you could use current cells index within the repeating group assuming you want the first entry to always start with 1.