Can I automatically assign licenses and permissions to new Drive Connect users?
Yes, using Flow, users can automatically assign the Drive Connect License and Drive Connect Standard Permissions to a Salesforce user when they are set as Active.
Creating the Flow
Flow Conditions
- Create a Record-Triggered Flow.
- For the Object, select User.
- Configure the Trigger to A record is Created or Updated.
- Set the Entry Conditions as isActive Equals true
- Set "When to run the flow for Updated Records" to Only when a record is updated to meet the condition requirements.
- Click Done.
Adding the Get Record Element
- Add a new element to the flow.
- Choose the Get Records Element.
- Set the following:
- Label - Package License ID
- Object - Package License
- Condition Requirements - All Conditions Are Met (AND)
- Field - Namespace Prefix
- Operator - Equals
- Value - driveconnect
- Sort Order - Not Sorted
- How Many Records to Store - Only the first record
- How to Store Record Data - Automatically store all fields
Adding a Decision Tree for Package Licenses
- Add a new element to the flow
- Select Decision Tree
- Set the following:
- Label – Does Package License Exist
- Outcome 1:
- Label - Package Exists
- Condition - {!Package_License_ID} isNull is false
- When to execute outcome - if the condition requirements are met
- Outcome 2 (Default outcome):
- Label - Does not exist
Creating a Drive Connect License Record
- Add an element to Package Exists (Outcome 1).
- Set the following:
- Label - Assign Drive Connect License
- How Many Records to Create - One
- How to Set the Records Fields - Use separate resources and literal values
- Object - User Package License
- Fields:
- PackageLicenseId - {!Package_License_ID.Id}
- UserID - {!$Record.Id}
Adding Get Record for Standard Permission User Set
- On the Flow, where the two outcomes meet, add a Get Records element.
- Set the following:
- Label - Standard User Permission Set
- Object - Permission Set
- Conditions - Name Equals Drive_Connect_Generate_Files
- Sort Order - Not Sorted
- How Many Records to Store - Only the first record
- How to Store Record Data - Automatically store all fields
Adding a Decision Tree for Permission Sets
- Add a new element to the flow.
- Select Decision Tree.
- Set the Following:
- Label - Does Permission Set Exist
- Outcome 1:
- Label - Permission Set Exists
- Condition - {!Standard_User_Permission_Set.Id} isNull is false
- When to execute outcome - if the condition requirements are met
- Outcome 2 (Default outcome):
- Label = Does not exist
Creating a Permission Set Record
- Under the Permission Set Exists outcome, add a Get Records element.
- Set the following:
- Label - Assign Permission Set
- How Many Records to Create - One
- How to Set the Records Fields - Use separate resources and literal values
- Object - Permission Set Assignment
- Fields:
- PermissionSetId - {!Standard_User_Permission_Set.Id}
- AssigneeId - {!$Record.Id}
- Fields:
The Flow is complete! Save and activate your Flow.
How to Test Your Flow
- Ensure you have an available license in Drive Connect to assign.
- In Salesforce Setup, create a new Salesforce user. Be sure that the user is set as active.
- Once the user is created, return to the Drive Connect License and Permissions page to see if the user was assigned.
Note: If you do not have enough licenses to assign, Salesforce will not let you create users. On user creation, you will get an error page stating that you are unable to access the page.