You might wanna take a look on this post Avoiding duplicate selection in repeat group. The provided solution could also work for your case, with a caveat that the join() might have limitations on how much characters it could hold ~255, not very sure, so please do test exhaustively.