 Hello, friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate you how you can automatically assign a permission set when a user is created in Salesforce. So what we need to do to accomplish this, we need to create a permission set. Then we will be using create record triggered, sorry, we will be creating a record triggered flow. And then we will create a user so that we can see whether permission set is assigned automatically to the user or not. And if you want to watch more Salesforce related videos. So I have placed all links related to my videos on my website that is studiesalesforce.com so you can visit that too. So now I'm going to start the demonstration. So first let me search for permission set. So we need to create permission sets but I will be using any existing permission set. So let's say I will be using this case permission set. So I'm going to assign this case permission set or whenever a user record is created right now. I need to search for the flow. So if you don't have any permission set or let's say you have certain permission that you want to assign so you can create new permission set as well. So that is pretty simple. So now I'm going to create new flow. So here you need to choose record triggered flow. And from here you need to choose record is created and after the record is saved. And if you want to assign that permission set upon record ablation as well so you can choose the option accordingly. And from here you need to choose the object so I'm going to choose user. So whenever our user record will be created so this flow will be executed automatically. Now I'm going to use get record element because I need to query the permission set details. So fetch permission set from here I need to search for the object. So I'm going to search for permission set right and here I'm going to choose field as label. So from here I'm going to copy this and pasting this here and rest I'm leaving as it is. So permission set details will be available to this. So I'm going to connect this. Now I'm going to create a record. Add permission set to user. So from here I'm choosing permission set assignment. So here you can see three options are available assigned ID. And two options are permission set group idea permission set ID. So earlier we used to have permission sets but now we also have permission set groups. So whatever you want to assign you need to fetch the idea of that permission set or permission set group. So right now we fetched idea of permission set only so that we are going to assign and assigning ID will be record ID. And permission set ID will be received from here. So this way assigning ID is user ID and permission set ID that we query through get record element. So this way we are going to create a record for assigning permission set to a user clicking on done and connecting this. So this way with these two elements we will be able to assign a permission set to the user whose record we are going to create. So now I'm going to save this. So add permission set to or we can say assign permission set to user. And I'm clicking on save activating this. So now we need to create a user. So I'm on user. So from here I need to create a user record. And after creation of this user record you will see a permission set will be assigned automatically. Right. So from here we need to fill all these details which are in lead. So let's say I'm filling all these details. From here I'm selecting this chatter free user clicking on save. So it is showing an error. So again I'm going to fill these details. So I'm filling all the information. And I'm choosing this force.com free user. Right. And I'm clicking on save. So this time it will. So why that error was coming because I was choosing free force.com free user license or chatter. So for that permission set won't be assigning because that permission set contains object permissions. So I deactivated one of my user. So now a Salesforce license is available. So I'm going to create that user and selecting profile as my user profile. Now I'm going to click on save. So now you can see this user record is created. And if I scroll it down so you can see here automatically a permission set is assigned. That is case permission. Right. So whenever you create a user. So automatically a particular permission set will be assigned. And if you choose permissions at group, then that permission set group will reflect here. So for that, what you need to do, you need to search for permission set groups. And you need to select the permission set group may label or developer name from here. So this is the API name and this is the label of this permission set group. And in flow where I get record for permission set. So you can select the cat record. And here you can select object as permission set group. So you can query this so that ID will be available. And then while creating the record here, you can select this permission set group ID instead of permission set ID. So this way you can share or you can assign permission set as well as permission set group to the user that user record you are going to create. And if you want to apply this feature for updation. So from here you can choose when a record is updated or record created or updated both. So I hope this way you understood how we can automatically assign a permission set whenever a user record is created. And if you want to watch more Salesforce related videos. So all the video links are available on my website that is study salesful.com. So do visit this so that you can learn more about Salesforce. Thank you for watching this video.