Hello - So, I’m plugging away at my test project called “Blood Pressure Buddy”. Here’s how it works, a user signs up and is paired with another person trying to lower their BP. they both log their entries and are compared to each other.
Here’s the problem, I’m having. When I new user is created, I need to assign them to a group.
Here’s how I thought about doing it in plain language.
- Create a Group ID field with the user.
- When user signs up, identify the highest Group ID number that exists for all users.
- If the highest Group ID number only returns 1 of that number (meaning that there’s not a complete pair) then give that number to the new user. For example, if there were 2 1s, 2 2s, but 1 3, the next user would get a 3.
- If there are 2 of the highest number (i.e. 2 4s) then assign the new user with a group ID of the next highest number, in this case it would be a 5.
This way all the users are getting a unique group ID, but there’s never more than. 2 users with a specific group ID, so you’ll have unique pairs.
The logic for this seems simply, but I can’t find a way in bubble to assign a group ID in this way during the sign up process.
Is there any way to do this in bubble?
If not, any thoughts on how to structure this so I could do this?
Here’s the screen shot of trying to assign a group ID to a new user.