Currently we are working on a project where we have to make accounts for a few types of users. We want to make a microflow to automatically assign an userrole to an account, but we get stuck. For example, when you click: 'add doctor', the userrole automatically is 'doctor'. Does anyone know how to solve this problem? Thanks in advance.
You would need to create your own version of the account management screen.
The roles are connected as a many to many relation.
The steps in your microflow would be:
Create a list of UserRole
Retrieve the role by its code. (Best use a constant to avoid hardcoding role codes in your microflows)
Add the role to the list
Create the account and assign the list to association UserRoles.