---
schema_version: "1"
id: 8bdb4a53a3d30dd891fb0508460b07650f2a408a94b3709a81c3b373e38b0d29
title: Automate Close Plans with Flow Builder
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/quip_template_lightning_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.quip_template_lightning_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 790c1067e8f076ca7df6eff518ac4eb1825b3c409aec7daf86d579909744b638
description: Save time manually creating and filling out Mutual Close Plans with templates in Flow Builder. Use Process Builder and Flow Builder to automatically add a Mutual Close Plan template to a record and generate an auto-populated Close Plan when the Opportunity stage changes. Add the copied document to a folder and send a message to @everyone to notify users that a document was created.
products:
  - Quip
  - Cross Cloud
release: "264"
---
# Automate Close Plans with Flow Builder

Save time manually creating and filling out Mutual Close Plans with templates in Flow Builder. Use Process Builder and Flow Builder to automatically add a Mutual Close Plan template to a record and generate an auto-populated Close Plan when the Opportunity stage changes. Add the copied document to a folder and send a message to @everyone to notify users that a document was created.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Lightning Experience</strong></td></tr></tbody></table>

Use a flow to automatically populate a Mutual Close Plan attached to an Opportunity. After you create a document from the template, the flow moves the document to a folder and sends a message in the conversation panel. Process Builder then autolaunches the flow when an Opportunity stage changes to Proposal/Quote.

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/images/icon_tip.png)

Tip This workflow works for other Salesforce objects. To add an Account Plan to an Account, set up the Quip Document component on an Account page, create an Account Plan URL field, and select Account as the object in Flow Builder.

## Set Up the Quip Document Component

Set up the Quip Document component on the Opportunity page layout. Create a Mutual Close Plan custom URL field to store Mutual Close Plans created from your template.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Lightning Experience</strong></td></tr></tbody></table>

1. Navigate to an Opportunity record in Lightning Experience.
2. Click the gear icon, and select **Edit Page** to go to the Lightning App Builder.
3. Create a new tab called Close Plan.
4. In the left pane, select **Quip Document** and drag it to your new tab.
    
    ![Quip Document component in Lightning App Builder](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/anywhere_quip_doc_component_opportunity.png)
5. Select **Different docs for each record**.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/images/icon_note.png)
    
    Note Different Docs for each record uses Flow Builder to add a template to a record. To use Flow Builder or let users manually add templates, select **One template for each record**.
6. To create a custom URL field to store the new document URLs, select **Create a new field**.
7. Enter Mutual Close Plan as the field label and field name. You can make changes later from the Object Manager.
    
    ![Create a Custom Field modal](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_custom_url_field_modal_228.png)
8. Save the action.

To add your Mutual Close Plan template to the Quip Document component and to automate Mutual Close Plan creation, create actions in Flow Builder and Process Builder.

## Create a Mutual Close Plan

Use Flow Builder to add your Mutual Close Plan template to the Opportunity and to automatically populate Mutual Close Plans created from it.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Lightning Experience</strong></td></tr></tbody></table>

1. From the Quick Find box in Setup, enter Flows.
2. Click **New Flow**.
3. Select **Autolaunched Flow** and click **Next**.
    
    Flow Builder displays the flow in the Auto-Layout flow layout. You can access Interactions, Logic, and Data via the plus icon.
    
    Process Builder later launches the flow when an Opportunity stage is changed.
4. Drag the Action element onto the canvas.
5. Select **Quip**.
6. Enter Copy Quip Document as the Quip action.
7. Name the action Create Mutual Close Plan from Template. To auto-create the API name, press **Tab**.
    
    ![New Action modal with Document URL and Source Record ID highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_process_flow_modal.png)
8. Enter the Document URL for the Mutual Close Plan ([https://quip.com/Rm1bAaCxx71a/OpportunityName-Close-Plan](https://quip.com/Rm1bAaCxx71a/OpportunityName-Close-Plan)).
9. Include the Source Record ID. Under Source Record ID, click **\+ New Resource**.
10. Select **Variable** as the Resource Type.
11. Enter the API name OpportunityRecord.
12. Select **Record** as the Data Type.
13. Select **Opportunity** as the Object.
14. Select **Available for input** and click **Done**.
15. When you get the “Data type of the resource you entered isn’t compatible” error for the Source Record ID, enter .id after OpportunityRecord. Select **Opportunity ID**.
    
    ![Opportunity ID highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_flow_opportunityrecordid.png)
16. Select **Manually assign variables**. Under Store Output Values, click **Document Link** and select **\+ New Resource**.
    
    ![New Resource modal with Resource Type, API Name, and Data Type highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_new_resource.png)
17. Select **Variable** as the Resource Type.
18. Enter NewDocumentURL as the API Name.
19. Select **Text** as the Data Type. Click **Done**, then **Done**.
20. Drag the Update Records onto the canvas.
21. Name the action Update Opportunity Record. To auto-create the API name, press **Tab**.
    
    ![Update Records modal](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_new_update_records.png)
22. Select **Specify conditions to identify records, and set fields individually**.
23. Enter Opportunity as the Object.
24. Under Filter Opportunity Records, enter Id as the Field, select **Equals**, and enter {!OpportunityRecord.Id}.
25. Under Set Field Values for the Opportunity Records, enter Mutual\_Close\_Plan\_\_c as the Field and {!NewDocumentURL} as the Value. Click **Done**.
26. Connect the elements and click **Save**.
    
    ![flow canvas with Start, Create Mutual Close Plan, and Update Records](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_flow_canvas.png)
27. Name the flow. For this example, we use the name Create Close Plan from Template. To auto-create the API name, press **Tab**. Click **Save**.
28. Click **Activate**.

## Trigger the Process

Create a process that launches the Mutual Close Plan flow when an Opportunity stage is changed to Proposal/Quote. When a user updates the Opportunity stage to Proposal/Quote, a Mutual Close Plan is created from the attached template and autopopulated based on the Opportunity’s data.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Lightning Experience</strong></td></tr></tbody></table>

1. From the Quick Find box in Setup, enter Process. Select **Process Builder**.
2. Click **New**.
    
    ![New Process modal](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_new_process.png)
3. Name the process Create Close Plan. To auto-create the API name, press **Tab**.
4. Select **A record changes** as the process trigger. Click **Save**.
5. Click **\+ Add Object** and select **Opportunity** as the object type.
    
    ![Opportunity object type and "when a record is created or edited" highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_process_add_object.png)
6. Start the process **when a record is created or edited**. Click **Save**.
7. Click **\+ Add Criteria**.
    
    ![Define Criteria with Opportunity Stage Change highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_process_define_criteria.png)
8. Name the criteria Opportunity Stage Change.
9. To determine when to trigger the process, select **Conditions are met**.
10. Set the conditions:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col> <col> <col> <col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Field</strong></td><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Operator</strong></td><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Type</strong></td><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Value</strong></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">[Opportunity]Stage</td><td class="slds-cell-wrap" style="vertical-align:top;">Equals</td><td class="slds-cell-wrap" style="vertical-align:top;">Picklist</td><td class="slds-cell-wrap" style="vertical-align:top;">Proposal/Quote</td></tr></tbody></table>
11. Click **\+ Add Row** and set conditions:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:25%"> <col style="width:25%"> <col style="width:25%"> <col style="width:25%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Field</strong></td><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Operator</strong></td><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Type</strong></td><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Value</strong></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">[Opportunity]Stage</td><td class="slds-cell-wrap" style="vertical-align:top;">Is changed</td><td class="slds-cell-wrap" style="vertical-align:top;">Boolean</td><td class="slds-cell-wrap" style="vertical-align:top;">True</td></tr></tbody></table>
12. Under Conditions, click **All of the conditions are met (AND)**.
13. Click **Save**.
14. Click **\+ Add Action**.
    
    ![Flows, Action Name, Flow Name, and Flow Variables highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_process_launch_flow.png)
15. Select **Flows** as the Action Type.
16. Name the action Call Flow to Create Document from Template.
17. Select the flow **Create\_Close\_Plan\_from\_Template**.
18. Set the flow variables:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:33.33333333333333%"> <col style="width:33.33333333333333%"> <col style="width:33.33333333333333%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Flow Variable</strong></td><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Type</strong></td><td class="slds-cell-wrap" style="vertical-align:top;"><strong>Value</strong></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">OpportunityRecord</td><td class="slds-cell-wrap" style="vertical-align:top;">Field Reference</td><td class="slds-cell-wrap" style="vertical-align:top;">[Opportunity]</td></tr></tbody></table>
19. Click **Save** and then **Activate**.

When your users update an Opportunity stage to Proposal/Quote, a Mutual Close Plan is automatically created and data from the Opportunity is autopopulated. The created document is then stored in the Mutual Close Plan field added to the Opportunity layout.

## Move and Share a Mutual Close Plan

To make it easier to manage your Mutual Close Plans, use Flow Builder to move Mutual Close Plans created from a template to a specific folder. Automatically send a message in the conversation pane to let users know that a document was created.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Lightning Experience</strong></td></tr></tbody></table>

1. In Flow, open the Create Close Plan from Template flow.
2. Drag a new action onto the canvas after Update Records.
3. Select **Quip**.
4. Enter Add Quip Document to Folder as the Quip action.
5. Name the action Add Quip Document to Folder. To auto-create the API name, press **Tab**.
    
    ![New Quip Action with Label, API Name, Document URL, and Folder URL highlighted.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_flow_new_add_doc_to_folder.png)
6. For the Document URL, enter {!NewDocumentURl}.
7. To get the folder URL, first go to the Quip Admin Console.
    
    ![Quip Admin Console with Include Docment Titles and Folder Titles in URLs highlighted](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_flow_admin_console_folder_title.png)
    
    1. Under Settings, click **Site Settings**.
    2. Disable **Include Document Titles and Folder Titles in URLs**.
    3. In Quip, go to the folder where you want to add Mutual Close Plans created from a template. Copy the folder URL.
    4. Paste the folder URL in the Flow Builder action and click **Done**.
8. Connect the elements and click **Save**.
9. To send a message alerting everyone that a document was created, drag a new action onto the canvas.
10. Select **Quip**.
11. Enter Send Message in Document as the Quip action.
12. Name the action Notify Everyone. To auto-create the API name, press **Tab**.
    
    ![Send Message in Document action](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_flow_new_message_in_doc_action.png)
13. For the Document URL, enter {!NewDocumentURL}.
14. Enter a custom message. To make sure that everyone gets notified, include @everyone.
15. Click **Done**.
16. Connect the last action. Click **Save As** and then **Activate.**
    
    ![Final canvas layout with everything connected](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/quip_flow_final_canvas.png)

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/images/icon_example.png)

Example

 [![Watch Video Demo](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/play_btn.png) Watch an Account Plan Automation Demo (English only)](https://salesforce.vidyard.com/watch/NzZb6RFrBmdD8yPpcPM5bH)

Your flows and process are ready to go! To see them in action, go to an Opportunity page and change the stage to Proposal/Quote.