# Session-based invite codes for users without sign-in

**URL:** <https://community.glideapps.com/t/session-based-invite-codes-for-users-without-sign-in/77592>\
**Category:** Ask for Help\
**Created:** [November 4, 2024, 2:20am UTC](https://community.glideapps.com/t/session-based-invite-codes-for-users-without-sign-in/77592 "2024-11-04T02:20:29Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![aspiers](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/aspiers/32/81524_2.png) [@aspiers](https://community.glideapps.com/u/aspiers)\
**Post date:** [November 5, 2024, 10:55pm UTC](https://community.glideapps.com/t/session-based-invite-codes-for-users-without-sign-in/77592/18 "2024-11-05T22:55:52Z")

</div>

> [@Jeff\_Hager](#):
>
> If you already convinced a user to sign in, and you automatically generate an invite code, then what’s the point? You already know who the user is. You can can easily see if they have taken the survey or not. All based on user email. What’s the point of an extra step involving an invite code?

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:

> [@Why are plugins totally undocumented?!](https://community.glideapps.com/t/why-are-plugins-totally-undocumented/77648):
>
> As a Glide newbie, it seems there is a pretty huge hole in the docs relating to plugins and experimental computed columns. Imagine you are a new user who wants to figure out how to get Glide to randomly generate random numbers: Search the docs for “random” → nothing useful Search the forums → find this post from 2021: [new Roll Dice & Random Number columns](https://community.glideapps.com/t/roll-dice-random-number-columns/33613) Follow the link to [Roll Dice column | Glide](https://www.glideapps.com/plugins/dice) Think “oh great, Glide has plugins!” Note that that page doesn’t have any text explaining how to …

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!

---

_[View the full topic](https://community.glideapps.com/t/session-based-invite-codes-for-users-without-sign-in/77592)._
