Automatically Assigning And Unassigning Licenses Using Flows

Author: Dilsha Khan

Automatically Assign Licenses

1. By using some of the tools in Salesforce, you can easily and automatically assign licenses to your users. 

2. Navigate to Setup in SFDC, then to Flows. Create a new flows automation by clicking the New Flow button, then selecting ‘Record-Triggered Flow’

3. Select the User object as the triggering object, then select “A record is created or updated” for the “Trigger the flow when: ” setting. Leave the rest of the settings on their default selection, and click Done.

4. Click the plus icon under the Start element and select ‘Decision’ to add a decision element underneath the ‘Run Immediately’ path. Label your decision element ‘Identify User’ and then configure the element like this:

Note: You will have to navigate through each resource to select it. For example, to populate the first resource shown above ($Record > Active), you must type Record, then select ‘Record’ from the list pop-up. Then, without moving your text cursor, continue typing ‘Active’, then select ‘Active’ from the list pop-up.

After clicking the done button, your flow should now look like this:

5. Underneath the Standard User/Sales path, click the plus button to add an Action element. To assign Core licenses, search for the ‘Assign Licenses in Groove’ action and configure it as shown below, clicking Done afterward.

6. To automatically assign Flow licenses, repeat step 5 but indicate licenseType = Flow. To automatically assign Dialer licenses, repeat step 5 but indicate licenseType = Dialer. If you decide to assign all 3 license types, your flow will now look like this:

7. Optionally, assign different licenses to a separate Salesforce profile:

  • Add another Outcome to your Decision element. Identify and input criteria to find another set of users, for example, the “Customer Success” department. Don’t forget to include the Active condition (as shown in step 4) to ensure you’re only assigning licenses to Active users.
  • Add an Immediate Action under the new “Customer Success” path to “Assign Licenses in Groove” for each license type you’d like to give to this set of users

8. Activate the flow and test it

Once activated, this flow will run each time a user record is updated (e.g. if you click Edit/Save). It will then test what conditions are met and assign each Groove license respectively, as long as your organization has available licenses of those types.

Automatically Unassign Licenses

Just like we are able to assign Licenses automatically, we can similarly call an Apex class to automatically unassign licenses.

Example: Automatically unassign licenses to a user once they have become Deactivated in Salesforce.

Steps:

1. Edit your existing flow by configuring a new outcome in your decision element that looks like this:

2. Underneath the Deactivated User path, click the plus button to add an Action element. To unassign Core licenses, search for the ‘Remove Licenses in Groove’ action and configure it as shown below, clicking Done afterward.

3. To automatically unassign Flow licenses, repeat step 5 but indicate licenseType = Flow. To automatically unassign Dialer licenses, repeat step 5 but indicate licenseType = Dialer. If you decide to unassign all 3 license types, your flow will now have the Deactivated User path built out like this:

4. Activate the flow and test it.

Once activated, this flow will run each time a user record is updated. It will then test whether the User was set to inactive and unassigned for each Groove license respectively.

We use cookies on this site to enhance your user experience. For a complete overview of how we use cookies, please see our privacy policy.