I want to automatically assign a role to a user when signing up.
I created a User Roles data type and I have 2 roles in that data type. One is “User,” the other is “Admin.”
Within the User data type, I have a User Role field that is mapped to the User Role data type.
I then added an action to when they sign up to Make Changes to the Current User and assign the user role to “User”. However, this is not working. What am I doing wrong? I’m new to Bubble, so please forgive me if this is a stupid question. See my attached screenshots.
Usually, we take a simpler approach in Bubble. For example, we might make an Option Set called User Role with two values: User and Admin. When a user signs up, we would just assign that user’s role to User. No need for searches at that stage.
I made it even simpler: In the User data type, I include a Role field, but I leave it blank. If the person is an Admin, I can change it to Admin later, otherwise I don’t put anything there. In my workflows, I only let them do admin tasks if the user’s Role is Admin.
Oops welcome onboarding this is an easier step to follow, create on option set with called user role with value Admin and User.
The create a data type User_role field under User data type and Link it to the option set user_role.
You see a drop down and check user
This make every user signing to your app to be automatically assigned to user data rike in your app.
I hope this sounds clear enough
The reason I was doing it this way is because I was thinking about adding other types of roles later on that have other permissions. For instance, an editor or an author. I was hoping to make a UI that would allow an admin to change permissions of each role on a webpage instead of directly altering the data in the app data.
I was hoping to learn how to do that, but maybe I need to take baby steps and use your suggestion for now.