One point is that we need to randomly assign each user to one of six possible groups, and ensure an even distribution of users over those groups. By creating all the invite codes up front, we can assign invite codes to groups and ensure this distribution.
After more searching, I finally found how to add a column with Type > Computed > Experimental > Number > Roll Dice, which was surprisingly undocumented. I’ve posted a separate thread about that:
But now I figured it out, I guess this could help.
However there were two more reasons for using preallocated invite codes.
Firstly, we want to collect all survey responses in a single table, regardless of whether they were collected by one of the admins running the app on their phone and talking with users face-to-face, or whether the users were logging in themselves remotely.
In the former case, the admin would be logged in as themself (to save the extra friction of requiring the user to sign up/in), would get the user to roll a physical die (to make it feel more like a game), and then tap the result of the die roll into an admin screen which would create a new stub entry in the responses table ready to be filled out by the user via the admin’s phone.
In the latter case, yes ideally we could skip the invite code bit, but we would still need a new row in the responses table for that user. And we also want to cap the number of survey responses. Once invite codes are all used up, no more users can participate. If invite codes can be skipped, then some other capping mechanism would be needed. I guess we could maintain a count of all users and add some conditional somewhere to gate on this.
But supporting both use cases (i.e. admin logged in with f2f interaction & users logging in themselves) within the same app seems awkward, especially if only one of them uses invite codes, because then we probably need duplicate copies of several tabs and actions to handle slightly different conditionals and fields.
It’s all a lot harder than I expected
Nevertheless, massively grateful for your assistance up to this point!