Automation Champion

Automating Salesforce One Click at a Time
Automation Champion
  • Home
  • About Me
    • Testimonials
    • Resources
  • Process Builder
  • Salesforce Flow
  • Pardot
  • Apex
  • Training Details
    • Salesforce Administrator
    • Salesforce Advanced Administrator
    • Platform App Builder
    • Lightning Flow
    • Pardot
    • Sales Cloud
    • Service Cloud
    • Community Cloud
    • Hands-on Excercises
  • My Books
  • Contact Me
  • Tag: Auto assign permission sets

    • Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)

      Posted at 11:14 AM by Rakesh Gupta, on November 26, 2020

      To understand how to solve the same business use case using Process Builder and Salesforce Flow. Check out this article Getting Started with Process Builder – Part 78 (Auto Enable Lightning Experience for New Users).

      Big Idea or Enduring Question:

      • How can you use Flow to automatically assign permission sets to new users?

      Objectives:

      After reading this blog post, the reader will be able to:

      • Use After-save Record-Triggered Flow to assign permission sets to new users
      • Best practice to refer Permission Set into Record-Triggered Flow
      • Use a Decision element to find – record variable or record collection variable contains a record or not
      • Use After-save Record-Triggered Flow to create a record

      Business Use case

      Brenda David is a System Administrator at Universal Containers (UC). She has received a requirement to auto-assign Two Factor Authentication permission set to the new users.

      Automation Champion Approach (I-do):

      Salesforce allows you to add Permission Sets to the User to extend the user’s functional access without changing their profile. For example, you can grant Modify All access to the Account object to a set of users without changing their profile or creating a new profile.

      This is a basic use case to start with the lightning flow. To solve the above requirement, we will use the After-save Record-Triggered Flow.

      Before proceeding, you have to understand the PermissionSetAssignment objects in Salesforce.

      • PermissionSetAssignment:- This object represents an association between a User and a PermissionSet.
      Field Name Details
      AssigneeId ID of the user to assign the permission set.
      PermissionSetId ID of the PermissionSet to assign to the user.

      Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it. Let’s begin building this automation process. Read the rest of this entry!

      Posted in Salesforce Flow, User Management | 45 Comments | Tagged Add permission set, Add permission sets, add Permission Sets to new User, Add permission sets to user, Add permission sets to user in Salesforce, ADM 201, adm 201 certification, adm 201 salesforce, Advance flow, Assign permission set lightning flow, Auto add Permission Set, Auto add Permission Sets, Auto add Permission Sets in Salesforce, Auto add Permission Sets in Salesforce to user, Auto add Permission Sets to new User, Auto add Permission Sets to new Users, Auto assign permission set, Auto assign permission set to new user, Auto assign permission sets, Auto assign permission sets to new user, Automatically add Permission Sets to new User, Create a Salesforce Record from a Flow, Create record through flow, Factor Authentication, flow builder in salesforce, flow builders, Flow examples, FlowBuilder, Lightning Flow, Lightning Flow example, lightning flows in salesforce, New Flow Trigger, Permission Set Assignment, permission sets, Permission Sets in Salesforce, PermissionSetAssignment, PermissionSetId, sales force automation software, salesforce, salesforce automation, salesforce automation tools, Salesforce CRM, Salesforce Flow, Salesforce Flow Example, salesforce flows, salesforce lightning flow, salesforce lightning flow examples, salesforce sales cloud, salesforce trailheads, SFDC, Two Factor Authentication
    • Auto Add/Remove Permission Set – Part 1

      Posted at 3:41 AM by Rakesh Gupta, on August 14, 2014

      Permission Sets are helpful for providing a particular set of functionalities to a user in addition to the permissions provided to their Profile. For example, you may want to grant only a few of your sales users to convert leads or two-factor authentication access. In this case, rather than having a special sales profile with the convert lead permission or two-factor authentication permissions. You have to create a permission set with the lead conversion permission and assign it to a specific user. So most of the time you came around this situation mentioned below

      • Assign permission set to a user after 7 days from Today i.e.  21-Aug-2014 future date
      • Assign permission set for a specific time period 22-Aug-2014 to 30-Aug-2014 (Like you have defined start and end time)
      • Remove permission set from user on 31-Aug-2014 i.e. future date

      Note: – Remember Today is 14-Aug-2014.

      So what you will be done in these cases, wants’ to automate this process if yes then have a look at this article.

      Business Use Case

      Management in Universal Container wants to automate permission set assignment process so their admin workload will be reduced.

      Solution for the above business requirement

      In this article, I am going to discuss how to auto assign Permission Sets to a user and In the next articl I, will discuss about auto remove Permission Sets. First of all create few fields on the User object to save condition to auto assign Permission Sets to the user. In this demo I will create few fields on the User object as shown in the below screenshot

      Custom Fields on User object

      Custom Fields on User object

      To solve this requirement we will use Visual Workflow and Workflow Rule (i.e Headless Flow).  Before going ahead with the solution you have to understand about PermissionSetAssignment Object. It’s represents the association between a User and a Permission Set. Below are the key fields from PermissionSetAssignment object

      Field Name Details
      PermissionSetId ID of the PermissionSet to assign to the user specified in AssigneeId.
      AssigneeId ID of the User to assign the permission set specified in PermissionSetId.

      To develop this application follow the below instructions

      1) Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows
      2) Click on New Flow, it will open flow canvas for you. Create Two Text type variable UserID (To pass User ID) and PermissionsetID (To pass permission set ID )
      3) Drag and drop a Record Create ( Give the name Assign Permission Set) onto the window to assign permission set to user and map the fields according to below details

      • Select Object PermissionSetAssignment
      • AssigneeId=  {!UserId}
      • PermissionSetId= {!PermissionSetID}, You can take help from the following screenshot
      Assign Permission Set

      Assign Permission Set

      4) Finally our Flow will look like the following screenshot

      Auto Add Permission Set to User

      8) Save the flow with name Add Permission Set and close the canvas.

      Create Workflow rule to fire our Flow

      Our next task is to create a workflow on the User object on creation and every time it’s edited event. To create a workflow on the User object follow the below instructions

      1) Click on Name | Setup | App Setup | Create | Workflows & Approvals | New Rule
      2) Select object  User from the drop-down
      3) Enter Name, for Evaluate criteria  select Created, and any time it’s edited to subsequently meet criteria ( To create a time dependent workflow), For Rule Criteria select From Date != False  and  Start= False as shown in the following screenshot

      Workflow Rule1

      Workflow Rule1

      4) Now Add a time trigger to  to set Start flag True after 1hr of From Date. To do this click on Add Time Trigger button and Set the length after how many days/hours workflow will fire  i.e.  in hours and days, I selected 1hr after the From Date. Now add one field update action for time dependent workflow and set Start flag to True. You can take help from the following screenshot

      Time based action

      Time based action

      5) Save the workflow and activate it.
      6) Create another workflow (i.e. workflow Rule2 ) on the same object to fire our Flow, set entry criteria of trigger is Start= True

      Workflow Rule2

      Workflow Rule2

      7) Add one Immediate Workflow Actions i.e. New Flow Trigger and Select Flow (Add Permission Set) and set Variable (UserID and PermissionSetID) value as shown in the following screenshot

      New Flow Trigger Action

      New Flow Trigger Action

      8) Add one Immediate Workflow Actions i.e. New Field Update and Set Start flag to False.
      9) Save the workflow and activate it.

      It’s time to test this feature

      1) Go to the User’s detail page to whom you want to assign Permission Sets and fill the detail. In this demo I am going to assign Permission Sets with Name “Test“,  it will look similar to below screenshot

      Permission Set Assignment Detail

      Permission Set Assignment Detail

      2) To check time dependent workflow queue Follow the path, Click on Name | Setup | Administration Setup | Monitoring | Time–Based Workflow and search the queue

      Time-Based Workflow Queue

      Time-Based Workflow Queue

      3) Below is the Proof of concept for your reference

      Proof of Concept

      Auto Add/Remove Permission Set – Part 2

      Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

      Posted in Salesforce Flow, User Management | 10 Comments | Tagged Add Permisison set to user, Add permission set, Add permission sets to user, ADM 201, adm 201 certification, adm 201 salesforce, Advance flow, Assign Permission Set based on start time, Assign Permission Set based on time period, Auto add Permission Sets in Salesforce to user, Auto Add/Remove Permission Set, Auto assign Perission set on future date, Auto assign permission set, Auto assign permission set in future date, Auto assign permission set in past date, Auto assign permission sets, Automate Permisison Set assignment Process, Cloud Flow, Cloud Flow Designer Workbook, Con 201, dev 401, DEV401, flow, Flow Designer, Flow examples, Flow exmple, Flow Triggers For Workflow, FlowRockstar, FlowTrigger, FlowTriggerPilot, FlowX Flow Triggers, headless flow, Headless Flows, New Flow, Permission Set auto assign, Permission Set Auto Assignment, Permission Sets auto asisgnment, Permission Sets Auto Assignmen, Permission Sets in Salesforce, PermissionSetAssignment, PermissionSetId, Record Create, Salesforce Flow, Screen, screenshot, Sp14FlowHackathon, Trigger Flow, Trigger ready flow, Visual flow, Visual Work Flow, Visual workflow, Visual workFlow examples, Visual Workflow Flow Cloud Flow Designer, Visual Workflow Implementation Guide, Visualforce page, workflow rule
    • Search

    • Upcoming Trainings

      Salesforce Administrator Certification
      Salesforce Advanced Administrator Certification
      Salesforce Platform App Builder Certification
      Lightning Flow & Process Builder
      Advanced Lightning Flow
      Pardot Specialist & Consultant Certification
      Sales Cloud Consultant Certification
      Service Cloud Consultant Certification
      Community Cloud Consultant Certification
    • Sponsor #1

    • Sponsor #2

    • Sponsor #3

    • Sponsor #4

    • Order Now!

    • Buy My Book

    • Buy My Book

    • Recent Posts

      • Getting Started with Salesforce Flow – Part 58 (Customize Previous, Next, Finish, and Pause Button Label for Screen Flow!)
      • Streamline Data Collection with Salesforce-Connected Forms
      • Getting Started with Salesforce Flow – Part 56 (Merge Chatter Topics with the Help of Salesforce Flow)
      • Getting Started with Salesforce Flow – Part 57 (Adding Validation to Flow Screen Components)
      • Getting Started with Salesforce Flow – Part 55 (Add or Remove Followers to a Record with the Help of Salesforce Flow)
    • Salesforce ID Converter Build on Lightning Flow

      Converting 15 digit ID to 18 digit Salesforce ID
    • Blog Archives

    • Categories

  • Information

    • About Me
    • Affiliate Disclaimer
    • Contact Me
    • Privacy Policy
  • Top Posts

    • Learning Flow
    • Learning Process Builder
    • Getting Started with Process Builder - Part 60 (Just Say NO to Hard-Coded ID)
    • Salesforce Spring’21 Release Quick Summary
    • Getting Started with Salesforce Flow – Part 11 (Count Number of records in a Record Collection Variable)
    • Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
    • Getting Started with Salesforce Flow – Part 1 (Understand, Create & Use Variables in Flow!)
    • Getting Started with Salesforce Flow – Part 58 (Customize Previous, Next, Finish, and Pause Button Label for Screen Flow!)
    • Add Record to Multiple Chatter Groups - Parsing Multi-Select Picklist fields (Flow)
    • Learning Apex
  • Social Media

    • View Automationchampion’s profile on Facebook
    • View Automationchamp’s profile on Twitter
    • View Rakeshistom’s profile on GitHub