How to assign a User Role to a new Signup?

Hi,

I have created a Database Collection called User Roles. In this Collection, there are 5 User Roles available: Admin, Director, Coach, Mentor, and Founder.

I have created a Relationship between the Collection Users and the Collection User Roles. A User can have multiple Roles and a Role can have multiple Users.

I have created a Welcome Screen with 3 buttons: Founder, Coach, and Mentor. The 3 buttons lead to 3 different Signup Screens.

When a Founder signs up, I want to automatically add the User Role Founder to them. Same for Coaches and Mentors.

I have tied my best to find out by myself how to do this, but I failed. For example:

I have added a Custom List to the screen which is a List of User Roles with the filter Name is equal to Founder.
I then added the Signup form to the List and I set he Action to Update the Current User Role by Adding the Logged in User to the colums Users.

However, the Signup form stopped functioning when it is placed in a List. When I fill the Signup form in, the Form does not recognize text in the fields and notifies me that the fields are mandatory.
When I then drag the Signup form out of the List and test, then the form works normally again.

Could anyone guide me?

Thanks!
Henk

Hi @Henk ,

I have updated this cloneable app to adding more roles.

It may not be the exact features that you want, but you can replicate the logic here to other roles.

At welcome screen, there is make-list button and in the button there is a link to signup screen, so that we can get relationship data to fill in.

Follow along that app.

1 Like

Hi @Yongki ,

Thanks a lot! I have implemented your solution. It works like a charm. :grinning:

I love how you created an Initial Role and All Roles. This makes it easy to guide Users to their preferred start screen.

Why did you choose to use numbers instead of names for Roles? I understand it can avoid bugs as the result of typing mistakes, and with only two Roles, numders are easy to manage. But in my case, with 5 User Roles, numbers could quickly become confusing.

Is there any other advantage beside avoiding typing miste to use numbers instead of words?

Thanks,
Henk

Great to hear.

Numbers are easier to compare than text name and it can easily avoid duplication visually in the database editor.

If you have more than 2 roles, you can add more records in that collection as many as you want, if need to change the make-list at button to role number accordingly.

But if you still prefer name, you can still use that as they are already available as fields, it helps to do the sorting too.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.