How to Activate Session-Based Permission Set through Flow in Salesforce

We are aware of permission sets and also how it is helpful in Salesforce. But are we know what is session-based permission set and how can we activate this session-based permission set for a user without any coding? Yes, we can do it through the declarative approach that is Flow. We are going to learn here how to Activate Session-Based Permission Set through Flow.

How to activate session based Permission Set through Flow?

Follow this example.

Step-1 Clone Read Only profile named it “Read Only Clone”.

Step-2 Before Save give Run Flows permission.

Step-3 Create user named Lynda Herman.

Step-4 Assign Read Only Clone profile to Lynda Herman.

Step-5 Create a permission set same as showing in below image.

Step-6 In this Temporary Account Edit permission set give access Modify All to Account object.

Step-7 Now assign this permission set to Lynda.

Step-8 Create the flow now which can dynamically activate this session-based permission set.

  • From Set up in Quick find box, search Flow and click on it.
  • Click on New Flow button.
  • Choose Screen flow and click Next.
  • Drag Action element to canvas from Elements Section.
  • In Action Search Activate, and choose Activate Session-Based Permission Set.
  • Enter Label as Activate Temporary Account Edit Access.
  • In Set Input values, Permission Set Name field enter ‘Temporary Account Edit”.
  • Click Done.
  1. Click Save and give the flow Label as Activate Account Access.
  2. Activate the Flow.

Step-9 From Set up Quick Find Box enter Builder. Select Lightning App Builder.

Step-10 Click New and select App Page then click Next.

Step-11 Name page as Activate Temp Access Flow and click Next.

Step-12 Select One Region and click Finish.

Step-13 Drag the Flow component onto canvas, and for Flow, select Activate Account Access. (It not selected already.)

Step-14 Click Save and select Activate.

Step-15 On the Activation window, select Lightning Experience and for Lightning Apps add Sales.

Step-16 Save and click Back to exit Lightning App Builder.

For testing the session based Permission set working or not,

  1. Log in to Lynda Herman.
  2. Go to Account. Now unable to Access Account.
  3. Click on Activate Temp Access Flow, in the tabs section. We will see the message ‘Your Flow Finished’.
  4. Then again go to Account, refresh the page. Now we can access the account and edit it.

Read More on Session-Based Permission Set>>