Permission Set Salesfore

Assign Permission Set at the User Creation Made Simple: What You Need to Know | Salesforce Guide

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, the API Name will auto-populate. 
  5. Click Save.
Permission Set
 Create Permission Set for Assigned 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.
new flow
Record Triggered Flow
Select the Record Triggered Flow

dont miss out iconDon't forget to check out: Permission Sets in Salesforce - Learn About Its Different Types

Advertisement

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
    • Field: User | IsActive
    • Operator: Equals
    • Value: {!$GlobalConstant.True}
  7. Click Done.
Active User
Get a 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
    • Row 1
      1. Field: Name
      2. Operator: Equals
      3. Value: Tetsing_User
  7. How Many Records to Store:
    • Select Only the first record
  8. How to Store Record Data:
    • Choose the option to Automatically store all fields
  9. Click Done.
Assign Permission
Get Permission Set to Assign Permission for User

dont miss out iconCheck out another amazing blog by Aman here: Knowledge of Salesforce Flow and Different Types of Flows and Its Elements

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 Create: One
    3. How to Set the Record Fields: Use separate resources and literal values
    4. Object: PermissionSetAssignment
    5. Set Field Values for the Permission Set Assignment
    6. Row 1
      • Field: AssigneeId
      • Value: {!$Record.Id}
    7. Click Add Row
    8. Row 2
      • FieldPermissionSetId
      • Value{!Find_Permission_Set_Id.Id}
  3. Click Done.
  4. If you want to Remove Permission Set from the Assigned User then you will need to 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}
Permission Set to User
Assign Permission Set to User
Expiration Date
Set Expiration Date in the Permission Set to remove from User

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

Flow 

Perform the steps below: 

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

Responses

Popular Salesforce Blogs