 Hello, everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate a scenario based on record trigger flow. Let's understand the requirement of this scenario. In this video, I'm going to demonstrate how you can assign permission set automatically upon user creation. We will be doing this with the help of record trigger flow. You need to do three things. First, you need to create a permission set, then record trigger flow to configure so that we can have the automation so that permission set will be assigned to the newly created user. And then you can create a user and verify. So let's first create a permission set. You can search permission set in the setup. And from here, you can create a permission set. And if you want to use any existing permission set, so that is also okay. So here, I'm going to create new permission set, naming it as my demo permission set, and I'm clicking on save. So this way, this permission set is created now, right? And it is available to use. And if you want to see like to whom this permission set is assigned, so here you can see there is no user, right? Now we need to create a flow so that whenever a user record is created, then automatically this permission set will be assigned to that user. So now I need to search for flow. And I'm going to create new flow so that I can assign that permission set. So I just need to select record triggered flow. Clicking on create. So here, object I need to select the user because on user creation, I need to run this flow. Then a record is created. And here, I can apply the condition is active equals true. And then actions and related record. And then click on done. So whenever a record is created and if a user record is active, then only we need to perform this operation. Now, if you want to assign the permission set to any user, so you need to create a record for permission set assignment object, right? So you need to create a record for permission set assignment. So here, you can select this option, use separate resources and literal. And here you can search for permission set assignment. So you need to create record for this. And here you need permission set ID, right? Which permission set you want to assign. So for this purpose, we need to query the permission set that we need to assign to particular user. So before creation of permission set assignment record, we need to have get record element. So we need to get permission set. Here you can search for permission set object. Then here you need to pass the permission set name. So permission set name equals and from here, I am just fetching the permission set name. And only the first record automatically store all the fields and done. Now, so instead of this label, I think we can have the API name of this permission set, which is this. So instead of providing the label, just put the API name and then done. Now you will be able to create that record. Sorry, we need to select the create record. So you will be able to create record. So create permission set assignment. So we need to create one permission set assignment, use separate resources and literal values. So permission set assignment. Now here we have these four things, assign ID, then permission set ID. So assign ID will be the user ID. So you can just search for record. So this is the dollar record global variable, which will be having the information of the newly created user record. So from here, you can just have the ID. And then you need to assign the permission set ID so that we have in this get permission set dot permission set ID. So this way you need to set these two fields for this permission set assignment object and permission set assignment record will be created. So it means once you create a user record, so automatically this permission set will be assigned to that user. Now you can click on save. Now we can activate it. So this time we need to search for users so that we can create a user record. So I'm just clicking on new. So first name, last name I provided then from here I'm selecting the user license Salesforce and then profile I'm selecting standard user. Active is by default true. Now I need to populate the email ID and username. So username. So this is my username and if you go below so you can see it will generate the password and notify the user immediately. So now I'm just clicking on save. So once this record is created and if you scroll down so here you can see the permission set is automatically assigned to this user that my demo permission set, right? And to set the password, you will receive an email on this email ID. So if I go here, so if I refresh so you can see welcome to Salesforce verify your account. So here this email is available so that I can verify the account. So this way with the help of flow, you will be able to assign the permission sets automatically whenever a user record is created.