Assign Permission Set at the User Creation

Share This Post

Explore the power of precision in Salesforce user management! Our latest blog post unveils the art of assigning permission sets at the moment of user creation, ensuring a seamless blend of access and security from the start. Elevate your Salesforce journey with our step-by-step guide and unlock a new era of efficiency.

Step 1: Create a Permission Set

  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, and the API Name will auto-populate. 
  5. Click Save.
Create Permission Set for Assign Users

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

  1. Click Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows, then click New Flow.
  4. Select the Record-Triggered Flow. 
  5. Click Create.
Select the Record Triggered Flow

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 Conditions Are Met (AND)
  6. Set Conditions
    1. Field: User | IsActive
    2. Operator: Equals
    3. Value: {!$GlobalConstant.True}
  7. Click Done.
Get Newly Created Active User

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

  1. Under Toolbox, select Element
  2. Drag-and-drop the 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 Set object from the dropdown list.
  5. Select All Conditions Are Met (AND)
  6. Set Filter Conditions
    1. Row 1:
      1. Field: Name
      2. Operator: Equals
      3. Value: Tetsing_User
  7. How Many Records to Store:
    1. Select only the first record
  8. How to Store Record Data:
    1. Choose the option to store all fields Automatically. 
  9. Click Done.
Get Permission Set to Assign Permission for User

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:
    1. Enter Label the API Name will auto-populate.
    2. How Many Records to CreateOne
    3. How to Set the Record FieldsUse separate resources and literal values
    4. ObjectPermissionSetAssignment
    5. Set Field Values for the Permission Set Assignment
    6. Row 1:
      1. FieldAssigneeId
      2. Value{!$Record.Id}
    7. Click Add Row
    8. Row 2:
      1. FieldPermissionSetId
      2. Value{!Find_Permission_Set_Id.Id}
  3. Click Done.
  4. If you want to Remove the Permission Set from the Assigned User, you must set the Expiration Date.
  5. Create the Variable.
  6. Set the Variable type Formula.
  7. Set the API Name date.
  8. Select Data Type as Date/Time and Set the Formula of the Expiration Date NOW() + Adding No of Days according to the requirement.
  9. Row 2:
    1. FieldExpirationDate
    2. Value{!date}
Assign Permission Set to User
Set the Expiration Date in the Permission Set to remove from the User

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

perform the steps below: 

  1. Click Save.
  2. Enter the Flow Label the API Name will auto-populate.
  3. Click Save

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

NetSuite Salesforce Integration: An Automation Guide

NetSuite Salesforce Integration is the seamless connection between NetSuite, a leading cloud-based Enterprise Resource Planning (ERP) system, and Salesforce, a premier Customer Relationship Management (CRM) platform.