Automatically Assign Licenses
By using some of the tools in Salesforce, you can easily and automatically assign Groove licenses to your users. Groove's managed package contains an Apex class that can be called to automatically assign Groove licenses to your users.
Example: Automatically assign licenses to all active users that have the profile "Standard User" and the department is "Sales".
1. Enable Groove as a "Remote Site" in Salesforce so that Salesforce updates can be sent to Groove and we can update user licenses:
Go to Setup in Salesforce
Search for Remote Site Settings, and select it
Find the Remote Site called Groove, and select it
Edit, and make it Active. Then save
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 afterwards.
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 decided to assign all 3 license types, your flow will now look like this:
7. Optionally, to 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 "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 automatically assign Groove Licenses, we can similarly call an Apex class to automatically unassign Groove licenses.
Example: Automatically unassign licenses to a user once they have become Deactivated in Salesforce.
Pre-work: This example assumes you have set up the Remote Site Settings from the Automatically Assign Licenses section of this help article.
Additionally, if you do not have an existing flow automation that automatically assigns licenses, create a new Record-Triggered Flow that executes on the User object whenever a record is created or updated. Then, click the plus button to add a decision element labeled 'Identify User'.
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 afterwards.
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 decided 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 unassign each Groove license respectively.
Note: You will need Managed Package version 9.60 to use the Remove Method.