I’m building an app that allows users to join different groups. Users can create their own groups or be added to existing ones. To ensure that the app is secure, only users that are row owners of a group can access that group.
To do this, I created an array in Google Sheets (i.e. Member 1, Member 2). This works well, however it means that users have to know the email address of the user to add them to their group, and the email address has to be entered the exact same way that the invited user signs into the app, which isn’t always the case.
I’m hoping to find a solution where the owner of a group can invite users by a code or link - but I’ve run into issues on how to best achieve that.
At first I thought a code would work, but then was stumped on how to add the invited user’s email to the array of members once they enter the code to join.
Would it be possible to build a logic for Glide to add the member to the array without overwriting previously invited users? I almost achieved this with a long custom action (If member 2 is empty, then add user, if member 3 is empty add user, and so on).
But I couldn’t complete it, because the invited user cannot “see” the data for the group they want to be added to because it’s restricted to the row owners array - which they have not been added to yet.
For more clarity - when the invited user adds the unique invite code, there is a relation column that looks for the code amongst the groups to know which group to add the user to. But because the user is not yet a row owner - the data to the relation returns a blank value, even if there is a match.
As I’m typing this, I’m guessing that the only way may be to have an invite code and for users to “request access” to a group.
Group owner would share a code
Invited user would enter the code to request access
Group owner would then see the request and add the user with a button that has the custom action that I described above
But then, it kind of kills the user experience - and maybe adding users by email isn’t so bad. Any thoughts on this? Has someone successfully implemented the “invite with code” method with row owner protection?
All thoughts and theories welcomed