Use case:
A Community user needs to get permission automatically for the installed package to access the features inside the portal once they signup. We can achieve this using a flow. A Flow automates the business process, and it is part of Salesforce that collects data and performs actions in your org, or an external system. It helps to minimize post user creation manual activities. Let us see how we can achieve our scenario.
Objects Overview:
We are going to use two main Objects inside the flow as shown below,
Object Name | Description |
UserPackageLicense | This Object references a license of an installed package where we are going to assign the user. |
PackageLicense | This Object refers to a license of an Installed Package |
Steps to be followed:
- Create a Flow and choose Record-Trigger
- Define a formula whether user is created or updated
- Use a Decision element check above formula outcome
- Add get records element to find our package License id
- Use a Decision element to check whether license found ID or not
- Use a Create element to assign the package license id to the user
Step 1: Create New Flow:
Setup -> Flow -> New Flow
Select Record-Trigger Flow
- Object: User
- Trigger the Flow When: A record is created or updated
- Set Entry Criteria
- Condition Requirements: None
- Optimize the Flow for Action and Related Records
Click Done.

Step 2: Define formula whether user is created or updated
Here, we are checking the conditions as below criteria:
- User Created record is active
- User profile is your custom profile name (Here, we have chosen ‘Beneficiary which is my community profile)
Step 3: Use Decision element check above formula outcome
- Drag and drop the decision element
- Label: Created
- Condition Requirements to Execute Outcome: All Conditions are met
- Define the condition as decided above:
$Record->Active Equals to True
$Record->Profile Id-> Name Equals to ‘Beneficiary’ (your Custom Profile Name)

Step 4: Add get records element to find our package License id
Drag and Drop the Get Record element into the flow designer
Edit the Element with the properties below:
Object: Package License
Condition Requirement: Name Prefix: vlocity_ins (Your Installed Package Name prefix)
To find out the name prefix for your installed package,
- Go to -> Setup -> Installed Package -> Your Package -> ‘Namespace Prefix’ column


Step 5: Use Decision element to check whether license found ID or not
- Drag and drop the Decision element
- Label: License Found
- Condition: Package License from VloctiyInsPackageID -> Package License ID -> isNull -> False

Step 6: Use Create element to assign the package license id to the user
Drag and Drop Create Element, next to If License found step
Properties:
How many records to create: One
How to set the record fields: Use separate resources, and literal values
Object: User Package License
Fields:
PackageLicenseId – packageLicense from VlocityPackageID-> Package License ID
User Id -> $Record -> User ID
Click Done.

Flow Overview:
Outcome:
As a result, we will be able to assign the Package Manager License Id automatically when the user gets created to our community. So that community user can access the access the package features.