Assign Permission Set at the User Creation

Aman Garg
3 min readNov 6, 2022

--

  1. Click Setup.
  2. In the Quick Find box, type Permission Sets.
  3. Select Permission Sets, then click New.
  4. Label the Permission Set then press the tab key, the API Name will auto-populate.
  5. Click Save.

Step 2: Create a Record- Triggered Flow to Assign Permission Set at the time of User Creation. Step 3. configure the flow as follows:

  1. Trigger the Flow When: A record is created
  2. Run Flow: A record is created
  3. Object: User
  4. Set Entry Conditions
  5. Select All Condition Are Met (AND)
  6. Set Conditions
  7. Field: User | IsActive
  8. Operator: Equals
  9. Value: {!$GlobalConstant.True}
  10. Click Done.

Step 4: Adding a Get Record Element to Find Permission Set Id:

  1. Under Toolbox, select Element.
  2. Drag-and-drop Get Records element onto the Flow designer.
  3. Enter a name in the Label field; the API Name will auto-populate.
  4. Select the Permission Setobject from the dropdown list.
  5. Select All Conditions Are Met (AND).
  6. Set Filter Conditions
  7. Field: Name
  8. Operator: Equals
  9. Value: Tetsing_User
  10. How Many Records to Store:
  11. How to Store Record Data:
  12. Click Done.

Step 5: Create Records — Add Permission Set to New Users

  1. Under Toolbox, select Elements. Drag and drop Create Records onto the canvas.
  2. Input the following information:
  3. Enter Label the API Name will auto-populate.
  4. How Many Records to Create: One
  5. How to Set the Record Fields: Use separate resources, and literal values
  6. Object: PermissionSetAssignment
  7. Set Field Values for the Permission Set Assignment
  8. Row 1:
  9. Field: AssigneeId
  10. Value: {!$Record.Id}
  11. Click Add Row
  12. Row 2:
  13. Field: PermissionSetId
  14. Value: {!Find_Permission_Set_Id.Id}
  15. Click Done.
  16. If you want to Remove Permission Set from the Assigned User then you will need to set the Expiration Date.
  17. Create the Variable.
  18. Set the Variable type Formula.
  19. Set the API Name date.
  20. Select Data Type as Date/Time and Set the Formula of the Expiration Date NOW() + Adding No of Days according to the requirement .
  21. Row 2:
  22. Field: ExpirationDate
  23. Value: {!date}

In the end, Flow will look like the following screenshot:

perform the steps below:

Originally published at http://amansfdc.wordpress.com on November 6, 2022.

--

--

Aman Garg
Aman Garg

Written by Aman Garg

Sr. Executive - Training || 6x Salesforce Certified || 2x Copado Certified || Salesforce Mentor || Founder of Salesforce Learners

No responses yet