Delete Roles

Hi. I would like to know how I can remove certain Roles from an Account. For instance, when I add a new account being an Administrator in the module 'Administration', at the moment that I press save, I want to modify the microflow in order to remove certain Roles that the Administrator selected. I would also like to know if it is possible to show just certain Roles in the ReferenceSetSelector (in my case I don't want to show the role "Temp" but the rest, for example.
2 answers

Regarding the first part of the question, and assuming you are referring to project roles (as module roles cannot be assigned explicitly but are added to project roles in the modeler):

You could make a microflow where you retrieve the user roles you want to remove. (It's explained here how to do this easily). After that you'd simply use a Change Object activity in which you change System.UserRoles for the Account using the option 'remove' with the (list of) to be removed user role(s) as variable.

For the second part: it should be possible to add additional xpath constraints to your reference set selector, which can look for specific roles, or exclude certain roles.

Xpath would look something like:

[id = '[%UserRole_UserRole1%]' or  
id = '[%UserRole_UserRole2%]']


[id != '[%UserRole_Temp%]']

I have checked this question and I have found the answer to show just certain roles but still I want to remove certain roles in the microflow