---
title: "Can I automatically assign licenses and permissions to new Drive Connect users? - Appiphony"
url: "https://appiphony.com/docs/drive-connect/getting-started/faqs/assigning-licenses-permissions"
---

# 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

1. Create a **Record-Triggered Flow.**
2. For the Object, select **User**.
3. Configure the Trigger to **A record is Created or Updated**.
4. Set the Entry Conditions as **isActive Equals true**
5. Set "When to run the flow for Updated Records" to **Only when a record is updated to meet the condition requirements**.
6. Click **Done**.

#### Adding the Get Record Element

1. Add a new element to the flow.
2. Choose the **Get Records Element**.
3. 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

1. Add a new element to the flow
2. Select Decision Tree
3. 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

1. Add an element to **Package Exists** (Outcome 1).
2. 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

1. On the Flow, where the two outcomes meet, add a **Get Records element**.
2. 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

1. Add a new element to the flow.
2. Select **Decision Tree**.
3. 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

1. Under the Permission Set Exists outcome, add a Get Records element.
2. 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}**

The Flow is complete! **Save** and **activate** your Flow.

### How to Test Your Flow

1. Ensure you have an available license in Drive Connect to assign.
2. In **Salesforce Setup**, create a new Salesforce user. Be sure that the user is set as **active**.
3. 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.*
