EP - 22 | How to Auto Assign Permission Set to Users Using Flow | Lightning Flow Series⚡️


Auto Assign Permission Set To Users

In this blog we will learn how we can auto assign a permission set to all the users that are going to be created in the future in our org.
We can do it manually but that can be a time consuming task if we have a lot of users.
So, We will ask automation to do it.

Step 1 : Create a Record Trigger Flow because we want this flow to run whenever a record is created so in Object we will Select "User" and in "Trigger the flow when" we will select "A record is created".
After that for condition we will add "IsActive" equals to "True".

Have a look :

Step 2 : Take a Get Record Element to get the Permission Set that you want to assign to the Users. For Object we will select "Permission Set". If you don't know "Permission Set" is a Standard Object in salesforce in which all the permission sets are stored.

Now, for conditions we will write Name equals to "Permission Set Name".

Have a look at the Get Record Element :

Step 3 : Now, Take a Decision Element to check if the permission set we got in the previous step exists or not.

Here it is :

Here we are checking if permission set is null equals to false. If it is false that means permission set exists and is not blank.

Step 4 : Take a Create Record Element to Assign Permission Set.
For assigning permission set there is a Standard Object which is "Permission Set Assignment". We will create a record in this object.

For assigning it to a particular user there is a field in the object which is "AssigneeId". In this field we will put $Record > User ID.
For another field which is "PermissionSetId" we will put "Permission Set Get Record Element Name  > PermissionSet ID".

Have a Look :

That's it, your flow is ready. Now everytime a new user will be created this flow will run and assign permission set to that user.

Here is the flow :

If you want to see the detail video tutorial then checkout my youtube channel By clicking on this video link :

If you have any question please leave a comment below.

If you would like to add something to this post please leave a comment below.
Share this blog with your friends if you find it helpful somehow !

Let's learn and grow together.
Love and Peace! 🧡

Post a Comment