---
title: "Merging with Flows - Appiphony"
url: "https://appiphony.com/docs/drive-connect/integrations/merge-connect/merging-with-flows"
---

# Merging with Flows

1. Navigate to **Setup** > **Process Automation** > **Flows**.
2. From the Flows page, click **New Flow**.
3. Select either **Record-Triggered Flow** or **Schedule Triggered Flow**.
4. You will be prompted to set up your flow trigger criteria depending on how the flow will be initiated as well as configure the Salesforce object the action will take place on. You can go back to this screen by editing the **Start** node of the flow. For more information on building out your flow, please see the Salesforce documentation on [Defining Conditions in a Flow](https://help.salesforce.com/s/articleView?language=en_US&id=sf.flow_build_logic_conditions.htm&type=5).
5. Below the **Start** node, select **Add Element**, then select **Action**. This will auto-display the **Action** section to the right.
6. In the Action field, search and select **Automate Drive (apex-driveconnect_ _ AutomateDrive)**.
7. Fill out the required fields for **Label** and **API Name**. With **Merge Connect** installed and **Google File Generation** enabled, you will now see the Operation **New File from Template**. Select **New File from Template**.  
   > **Please Note**: This option will not appear unless all of the following are true:  
   > • Merge Connect is installed in your org  
   > • The Google File Generation feature is enabled and configured  
   > • You have assigned a license and the Merge Connect Standard User and Merge Connect ECA User permission sets.
8. Next, you will see a few additional options. Below is a list of the available options:

- **Publish Results Event** - Published a platform event on completion of the operation with its results in JSON format, including data such as the ID of a Generate File. By default, this is not enabled.
- **Template** - By default, the template is set to **From Drive**, which will allow users to select a template created through the **Template Builder** in **Merge Connect** for the set Object. However, this can be changed to the following option:  
  - From a Text Variable - Users can create a variable resource type with the data type of text that will contain a template ID (taken from templates created through the template builder) as the value
- **Generated File Format** - By default, it is set to Google Format. However, this can be changed to the following formats:
  - PDF Document (.pdf)
  - Microsoft File Format Equivalent
- **Template Name** - The **Select a Template** button will open up the Select Templates Modal.
- **Destination** - This can be changed to any of the following destinations:
  - Default Object Folder
  - Folder in Default Record Folder
  - Linked Folder
  - Parent Record's Default Record Folder
  - Folder in Parent Record's Default Record Folder
  - Parent Record's Linked Folder
  - My Drive
  - Folder from Drive

9. If the Template is set to **From Drive**, and the user clicks the **Select a Template** modal, they will be prompted with the **Select Templates Modal**. Here users can select a single published template. When searching for templates they can be searched by name or description. Choose your template, then click **Select**.  

10. Additionally, users can add a child operation by clicking **+ Add Child Operation**. Below is a list of the available options:

- **Save File to Salesforce** - On completion of the merge, the file will be saved to your org. You can also add an additional level child operation in **Update Record Field**.
- **Link File to Parent Record** - If there is a parent record for the record, then it will also link the file to the parent record's Drive Links component.
- **Update Record Field** - You can select a field on the object that on merge will update with one of the following values:
  - Drive File URL
  - Drive File ID
  - Salesforce Content Document ID
  - Salesforce Content Version ID  
    > **Please Note**: If no parent record exists and Link File to Parent Record is set, the automation will fail.

11. Now that your flow is completed, you can enter the required fields for **Flow Label** and **Flow API Name**, and click **Save**.  

12. Click **Activate**.  

13. Trigger your flow. Once completed you will see your generated document.
