For our user provisioning (from AD) I want to automate the permission set groups that are assigned to user with a specific function title. What I have found is how to assign a permission set using the Flow Builder (create a record in the object 'Permission Set Assignment'. But I have not been able to find the same for Permission Set Groups. Is this even possible?


Both PermissionSetAssignments and PermissionSetGroups are accessible as SObjects and can be created in the database when the appropriate permissions exist. I suggest you simply need to create the PermissionSetAssignment for the User referencing the PermissionSetGroup instance. This can be done straight-forwardly in Apex using something like:

PermissionSetAssignment assignment = new PermissionSetAssignment(
    PermissionSetGroupId = groupId,
    AssigneeId = userId);

insert assignment;

Of course, you should ensure this code is bulkified if you are handling bulk provisioning, and can be accessed from a flow as long as you create an InvocableMethod for it.

  • Thanks for the quick response! I'll let you know if this worked out. Feb 27 '20 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.