---
title: "Automating Files - Appiphony"
url: "https://appiphony.com/docs/drive-connect/features/automation/automate-files"
---

# Automating Files

Drive Connect Automation allows users to link existing Google Drive files or generate new files from templates directly within Salesforce. By setting up a Record-Triggered or Scheduled Flow, users can streamline the management and organization of files, ensuring accurate data and enhanced workflow efficiency.

### Automate Linking Existing Files

Drive Connect Automation allows users to automatically link existing Google Drive files to the Drive Links component by selecting the **New File Link** operation in a **Record-Triggered** or **Schedule-Triggered Flow**. In your flow, open a New Action Element node and follow the steps below:

1. Open the Operation picklist and select **New File Link**. ![Automate Drive action editor with New File Link operation selected from picklist](https://appiphony.com/wp-content/uploads/2024/06/Automate-Drive-action-editor-with-New-File-Link-operation-selected-from-picklist.png)
2. Open the **File to Link** picklist and select either **Parent Record’s Linked File** or **File from Drive...**![Automate Drive action editor with File to Link picklist open](https://appiphony.com/wp-content/uploads/2024/06/Automate-Drive-action-editor-with-File-to-Link-picklist-open.png)

**Parent Record's Linked File:**

- 1. Select the Lookup field to the parent record.  
     ![Automate Drive action editor with Lookup Field to Parent Record picklist highlighted](https://appiphony.com/wp-content/uploads/2024/06/Automate-Drive-action-editor-with-Lookup-Field-to-Parent-Record-picklist-highlighted.png)
  2. Add a **Linked File Name** to the input field. The file name must match the name of an **already linked Drive file** on the parent record. This links the existing parent file to the current record during automation.  
     ![Automate Drive action editor with Linked File Name input highlighted](https://appiphony.com/wp-content/uploads/2024/06/Automate-Drive-action-editor-with-Linked-File-Name-input-highlighted.png)

**File from Drive:**

1. Select **any Drive file** from the Google picker. When the automation is triggered, the file will be linked to the current record.  
   ![Automate Drive action editor with File from Drive option selected and Google Drive File assigned to action](https://appiphony.com/wp-content/uploads/2024/06/Automate-Drive-action-editor-with-File-from-Drive-option-selected-and-Google-Drive-File-assigned-to-action.png)

For more information on saving and activating your flow, see the [Creating Automations article](https://appiphony.com/docs/drive-connect/features/automation/automation-overview/creating-automations-with-flow/).

### Automate Generating Files from Templates

Drive Connect Automation allows users to automatically generate a Drive Connect template and link it to the Drive Links component by selecting the **New File from Template** operation in a Record-Triggered or Schedule-Triggered flow.

> Please note that automatically generating files from templates using Scheduled Flows requires the Mass Actions add-on. Please [contact sales](https://appiphony.com/contact-sales/) for more information.

1. In your Flow, open a **New Action Element** node.
2. Click the Operation picklist and select **New File from Template.**
3. Under Template, select the drop-down option **From Drive** and then click on **Select a Template**.
4. Select a template file from your Drive Connect templates folder within the Google picker. You can also create a new file from a template if you know the template ID. Select **From a Text Variable** from the template drop-down. If you create a text variable with the template ID as a value, you can use that to generate the files.
5. **Select a Destination** for the template to be created in Drive.
6. Select a **Generated File Format** for each file type:
   - **Google Doc:**  
     PDF Document (.pdf)  
     Microsoft Word (.docx)
   - **Google Sheet:**  
     PDF Document (.pdf)  
     Comma Separated Values (.csv)  
     Microsoft Excel (.xlsx)
   - **Google Slide:**  
     PDF Document (.pdf)  
     Microsoft PowerPoint (.pptx)
7. If you select **From a Text Variable** or **From Drive** without selecting a template, you will see a new set of generated file formats.
8. Optionally set whether the new file should be linked to the Salesforce record.

> ***Note:** If you receive a warning regarding insufficient access for the Automated Process User, ensure the folder location you select is accessible by the Automated Process User with full edit rights. For more information, please see the Granting Access to Folders in Drive article.*

#### Child Operations

When selecting **New File from Template** as your top-level operation, you can add additional child operations by selecting **Add Child Operation**. Below is a breakdown of each child operation and their behavior:

#### Save File to Salesforce

This child operation will save the generated Drive Connect template from the parent operation to Salesforce. For more information on using Save File to Salesforce, see the Save a linked Google Drive File to Salesforce article.

You can add **Update Record Field** as a child operation to Save to Salesforce. The values for this are:

- Salesforce Content Document ID
- Salesforce Content Version ID
- Salesforce Content Document Record URL
- Salesforce Content Document Public Link

#### New Drive Shortcut

This child operation allows you to auto-create a Drive Shortcut of the parent Drive file in any destination location. If selecting this operation, complete the following steps below:

1. **Enter a Shortcut Name.** the parent file name can also be modified. You can utilize merge fields in the shortcut name by selecting the brackets button within the field.
2. **Select a Destination** for the shortcut to be created in Google Drive.

#### New Link to Parent

Allows you to link the parent-level file to the parent Salesforce record. If selecting this operation, select a **Lookup Field to Parent Record.**

#### Update Record Field

Allows you to update a field from a Salesforce record with a value of either Google Drive Folder URL, Google Drive Folder ID, Salesforce Content Document ID, or Salesforce Content Version ID. If selecting this operation, complete the following steps below:

1. **Select a Field** that will be updated when the automation triggers.
2. **Select a Value**.

For more information on setting up a flow using the Automate Drive action, see the [Creating Automations article](https://appiphony.com/docs/drive-connect/features/automation/automation-overview/creating-automations-with-flow/).
