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
- Click Setup.
- In the Quick Find box, type Permission Sets.
- Select Permission Sets, then click New.
- Label the Permission Set then press the tab key, and the API Name will auto-populate.
- Click Save.
Step 2: Create a Record- Triggered Flow to Assign Permission Set at the time of User Creation.
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows, then click New Flow.
- Select the Record-Triggered Flow.
- Click Create.
Step 3. Configure the flow as follows:
- Trigger the Flow When: A record is created
- Run Flow: A record is created
- Object: User
- Set Entry Conditions
- Select All Conditions Are Met (AND)
- Set Conditions
- Field: User | IsActive
- Operator: Equals
- Value: {!$GlobalConstant.True}
- Click Done.
Step 4: Adding a Get Record Element to Find Permission Set Id:
- Under Toolbox, select Element.
- Drag-and-drop the Get Records element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Select the Permission Set object from the dropdown list.
- Select All Conditions Are Met (AND).
- Set Filter Conditions
- Row 1:
- Field: Name
- Operator: Equals
- Value: Tetsing_User
- Row 1:
- How Many Records to Store:
- Select only the first record
- How to Store Record Data:
- Choose the option to store all fields Automatically.
- Click Done.
Step 5: Create Records – Add Permission Set to New Users
- Under Toolbox, select Elements. Drag and drop Create Records onto the canvas.
- Input the following information:
- Enter Label the API Name will auto-populate.
- How Many Records to Create: One
- How to Set the Record Fields: Use separate resources and literal values
- Object: PermissionSetAssignment
- Set Field Values for the Permission Set Assignment
- Row 1:
- Field: AssigneeId
- Value: {!$Record.Id}
- Click Add Row
- Row 2:
- Field: PermissionSetId
- Value: {!Find_Permission_Set_Id.Id}
- Click Done.
- If you want to Remove the Permission Set from the Assigned User, you must set the Expiration Date.
- Create the Variable.
- Set the Variable type Formula.
- Set the API Name date.
- Select Data Type as Date/Time and Set the Formula of the Expiration Date NOW() + Adding No of Days according to the requirement.
- Row 2:
- Field: ExpirationDate
- Value: {!date}
In the end, Flow will look like the following screenshot:
perform the steps below:
- Click Save.
- Enter the Flow Label the API Name will auto-populate.
- Click Save.