---
schema_version: "1"
id: ac319e978996fe5eacc321a20d5f1c0478ff7c957c7d3c24efcac5a11974183e
title: Add Opportunity Team Members to a Close Plan
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/anywhere_add_users_to_doc_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.anywhere_add_users_to_doc_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7be2d9834b176c6e57361a427452fbf37c78301fc4ca9be64ecb2efa4220b266
description: Automatically add an Opportunity’s Team Members to a Close Plan when an Opportunity is created. Also add Opportunity Team Members to existing Close Plans already linked to an Opportunity so they always have a 360-degree view.
products:
  - Quip
  - Cross Cloud
release: "264"
---
# Add Opportunity Team Members to a Close Plan

Automatically add an Opportunity’s Team Members to a Close Plan when an Opportunity is created. Also add Opportunity Team Members to existing Close Plans already linked to an Opportunity so they always have a 360-degree view.

### 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 add Opportunity Team Members to an Opportunity Close Plan. Use Process Builder to create a Close Plan from a template when an Opportunity is created. After you create a document from the template, the flow adds the Opportunity Team Members to the Close Plan. Process Builder then also adds Opportunity Team Members to an Opportunity’s existing Close Plan.

## Set Up the Quip Document Component

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

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/quip_doc_component_setup_one_template_for_each_record.png)
5. Select **One template 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 One template for each record lets you add a template via Flow Builder or lets your users manually add a template. To use Flow Builder only, select **Different Docs for each record**.
6. Click **![Edit icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-anywhere_app-264-0-0-production-enus/c0406050-7b26-469a-9dc5-10d6c0c9c576/anywhere_app/images/button_edit_pencil.png).** You can either paste your Close Plan template URL or select a template from the Template Library.
7. Click **Next** and validate the template. The validation checks that you have access to the document, that link sharing is turned on, that the document is marked as a template, and that it isn’t a slide.
8. To create a custom URL field to store the new document URLs, select **Create a new field**.
9. Enter Close Plan as the field label and the 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)
10. Save and activate the action.

To automatically add Opportunity Team Members to a Close Plan created from the embedded template, create an autolaunched flow.

## Build a Flow to Add Opportunity Team Members to a Close Plan

Create an autolaunched flow in Flow Builder that automatically adds an Opportunity’s team members when a Close Plan is created from the template.

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. From the Manager tab, click **New Resource**.
5. Select **Variable** as the Resource Type, enter the API name OpportunityTeamMembers, select **Record** as the Data Type, and select **Opportunity Team Member** as the Object. Select **Allow multiple values (collection)**, and then **Available for input** and **Available for output**, and click Done.
    
    ![OpportunityTeamMember resource with fields 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/anywhere_new_resource_opp_team_members.png)
6. From the Manager tab, click **New Resource**.
7. Select **Variable** as the Resource Type.
8. Enter the API name OpportunityRecord.
9. Select **Record** as the Data Type.
10. Select **Opportunity** as the Object.
11. Select **Available for input** and click **Done**.
12. From the Elements tab, drag **Get Records** onto the canvas.
13. Enter a name for the action. Here, we use Get Related Opportunity Team Members. Select **Opportunity Team Member** as the Object, and set conditions. Here, we set All Conditions to be met, and OpportunityId to equal {!OpportunityRecord.id}.
    
    ![Get Records window with required fields 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/anywhere_get_records_opp_team_members.png)
14. Under How Many Records to Store, select **All records**. Select **Choose fields and assign variables (advanced)**, then enter OpportunityTeamMembers collection as the Record Collection.
15. Under Select Opportunity Team Member Fields to Store in Variable, select **ID** and **UserId**
16. Select **When no records are returned, set specified variables to null**, then click **Done**.
17. Connect the elements on the canvas. Save the flow and enter a name. Here, we use Add Opportunity Team Members to Close Plan.
18. From the Elements tab, drag **Loop** onto the canvas.
19. Enter a name for the loop. Here, we use Loop Through Opportunity Team Members. Enter OpportunityTeamMembers as the Collection Variable, and select **First item to last item** as the Direction. Click **Done**.
    
    ![Required fields 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/anywhere_loop.png)
20. Connect the Get Records and Loop elements on the canvas and click**Save**.
21. From the Manager tab, click **New Resource**.
22. Select **Variable** as the Resource Type, enter the API name UserEmailAddresses, and select **Text** as the Data Type. Select **Available for input** and **Available for output**, and click Done.
    
    ![Text variable with required fields 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/anywhere_new_variable_emails.png)
23. From the Elements tab, drag **Get Records** onto the canvas.
24. Enter a name for the action. Here, we use Get Opportunity Team User Record. Select **User** as the Object, and set conditions. Here, we set All Conditions to be met, and Id to equal {!Loop\_Through\_Oportunity\_Team\_Members.UserId}.
    
    ![Get Records window with required fields](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_get_records_emails.png)
25. Under How Many Records to Store, select **Only the first record**. Select **Choose fields and assign variables (advanced)**, then select **In separate variables**.
26. Under Select Variables to Store User Fields, select **Email** and **UserEmailAddresses**.
27. Select **When no records are returned, set specified variables to null**, then click **Done**.
28. Connect the Loop and new Get Records action on the canvas. Select **For each item in the collection**, and click **Done**.
29. From the Elements tab, drag a new action onto the canvas.
30. Select **Quip** and enter Add Members to Document.
31. Name the action Add Opportunity Members to Documents.
    
    ![Required fields 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/anywhere_add_members_to_doc_action.png)
32. For the Document URL, enter {!OpportunityRecord.Close\_Plan\_\_c}, where Close\_Plan\_cc is the API name of your custom URL field.
33. To give Opportunity Team Members edit and sharing access to an Opportunity’s Close Plans, include **Add Full-Access Members by Email Address**, and select **UserEmailAddresses**. Click **Done**.
34. Connect the **Get Opportunity Team User Record** Get Records element and your new action. To complete the flow, connect the action and the loop, then click **Save**.
    
    ![Final canvas with elements 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/anywhere_add_opp_members_final_canvas.png)
35. Activate the flow.

## Build a Process to Launch the Flow When an Opportunity Is Created

Create a process in Process Builder that automatically creates a Close Plan from a template when an Opportunity is created. Launch the previous flow to add the Opportunity’s Team Members to new and existing Close Plans.

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. Start the process **only when a record is created** and click **Save**.
6. Click **\+ Add Criteria**.
    
    ![Required fields 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/anywhere_process_conditions.png)
7. Name the criteria Close Plan URL is Null.
8. To determine when to trigger the process, select **Conditions are met**.
9. 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].Close_Plan__c</td><td class="slds-cell-wrap" style="vertical-align:top;">Is null</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>
10. Under Conditions, click **All of the conditions are met (AND)**.
11. Click **Save**.
12. Click **\+ Add Action**.
13. Select **Quip** as the Action Type, and name the action Create Close Plan from Template.
    
    ![Copy Document action with required fields 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/anywhere_create_doc_process_example.png)
14. Select **Copy Document** as the Quip Action, and enter the URL of the document you want to use as your Close Plan template.
15. Under Advanced, enter \[Opportunity\].Id as the Source Salesforce Record. To store Close Plans created from the template in your Close Plan custom field, select **Close Plan** as the Target Record URL Field.
    
    ![Source Salesforce Record and Target Record URL Field 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/anywhere_process_close_plan_advanced.png)
16. Save the action.
17. To add Opportunity Team Members to existing documents linked to Opportunities, click **\+ Add Criteria**.
    
    ![Close Plan URL is Filled In](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_process_not_null.png)
18. Name the criteria Close Plan URL is Filled In.
19. To determine when to trigger the process, select **Conditions are met**.
20. 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].Close_Plan__c</td><td class="slds-cell-wrap" style="vertical-align:top;">Is null</td><td class="slds-cell-wrap" style="vertical-align:top;">Boolean</td><td class="slds-cell-wrap" style="vertical-align:top;">False</td></tr></tbody></table>
21. Under Conditions, click **All of the conditions are met (AND)**.
22. Click **Save**.
23. Click **\+ Add Action**.
24. Select **Flows** as the Action Type.
25. Name the action Call Flow to Add Opportunity Team Members to Close Plan.
    
    ![Required fields 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/anywhere_process_launch_flow.png)
26. Select the flow **Add Opportunity Team Members to Close Plan**.
27. 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;">
                      <p>[Opportunity]</p>
                      <p style="margin-bottom:0;">Represents the Opportunity record that started the
                        process.</p>
                    </td>

                  </tr>
                </tbody>
              </table>
28. Click **Save** and then **Activate**.
    
    ![Final process canvas](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_final_process_canvas.png)

Your flow and process are ready to go! To see them in action, create an Opportunity in Salesforce.

- A Close Plan is automatically created and attached to the Opportunity record.
- The Opportunity Team Members are added to the Close Plan.
    
    ![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 Make sure you have Opportunity Team Members set up and that their Salesforce emails match their Quip emails.
- If you edit an existing Opportunity with a linked Close Plan, the process launches your flow and adds the Opportunity Team Members to the Close Plan.