Skip to main content
All CollectionsIntegrationsCRMs
Salesforce Lightning. Create and send PandaDoc documents
Salesforce Lightning. Create and send PandaDoc documents

Salesforce integration passes data from Salesforce objects (Opportunities, Leads, Contacts, Accounts, and custom objects) to documents.

Updated over a week ago

Note: This guide covers the functionality of the latest version of the PandaDoc <> Salesforce integration.

Availability:

  • PandaDoc: Business Annual* and Enterprise Annual plans*
    *This integration is available as a paid add-on.

  • Salesforce: “Professional”, “Enterprise”, “Unlimited”, “Developer edition”, "Performance".

The integration will work for Opportunities, Leads, Contacts, Accounts, and custom objects.

Skip to:

Learn how to install and configure PandaDoc module here.

Pass data from SFDC into PandaDoc

Note: When you create documents from your Salesforce opportunities, document value currency will inherit opportunity currency.

To pass data from Salesforce to PandaDoc document, first, you should create your template and set it up with variables (same as merge fields).

Passing Salesforce fields into PandaDoc

Before setting up your template with variables, create a variable list for each object you will use PandaDoc with.

Note: Variables must be set up for each object individually. Only the variables listed in that particular object will be available when creating a document from it (no cross-object population).

  1. For that, find Pandadoc Setup in the App Launcher

  2. Scroll down to Salesforce to PandaDoc data flow and click Configure tokens

  3. Next, select an object you want to modify the tokens list for. If you have PandaDoc installed in another object, click Add object. You will see a default list of variables/tokens on the right. To add more, check the fields you want to add to the variables/tokens list and click Save

  4. Open a Salesforce record, scroll down to PandaDoc, click the gear icon in the top right corner of the module, and choose Variables - this is what you can pass

  5. Open your PandaDoc template in a separate browser window, copy & paste variable names with the square brackets into the template.

When you create a document from Salesforce using this template, the variables will be filled out with the information from the CRM.

Note: In case the field in Salesforce is empty, the variable in the document will not be populated and you will have to fill it in manually.

Note:

  • Date variables formatting depends on the default date format set up in your workspace settings.

  • Currency variable formatting is based on the recipient view locale. Custom money variables will pass to the document without a currency symbol and formatting.Currency variable formatting is based on the recipient view locale. Custom money variables will pass to the document without a currency symbol and formatting.

Warning: Encrypted text fields cannot be passed through a variable.

Passing recipients from Salesforce to PandaDoc

Note: Passing recipients info best works with PandaDoc Roles. Learn how to setup roles on a template here.

By default Salesforce pushes the following recipient information depending on an object where your PandaDoc module is located:

  • from Opportunity: Contact Role info

  • from Account: Contact info + possible to push Account info

  • from Lead: Lead info

  • from Contact: Contact info

  • from Quotes: Contact info

In case you pre-assign a recipient on the template level, they will be automatically assigned to the role when the document is created via Salesforce.

You can configure which field from Salesforce will be mapped to a role in PandaDoc as well as set up which fields will be sent as the following parameters:

  • First name

  • Last name

  • Email

  • Company field

  • Phone field

  • Role field

  1. Go to App Launcher and find PandaDoc setup

  2. Scroll down to Salesforce to PandaDoc data flow and select Configure Recipients.

Note: You will see default mapping for default objects. You can change them or add new mappings for custom objects.

If you want PandaDoc to automatically map recipient to a specific role, you need 2 things:

  • Role field configured in the Recipients mapping.

  • Have identical Role names in Salesforce and in the PandaDoc template.

If you have this set up right, PandaDoc will insert the respective recipient into the respective role when you will be creating documents.

Note: PandaDoc pulls all related contacts from Salesforce into the document. If you want to remove any, delete them on the role popup window or in the recipients section on the document.

If you generate documents from a quote or a case, you might be using a lookup field to a specific contact record. You can specify what lookup fields to use as recipients by going to PandaDoc Setup > scrolling down to Object Customization settings. Find the object you need to set this up for and click Setup on the right-hand side.

Then choose the field to use as a recipient and click Save. You can choose up to five fields.​

Next, set up the recipient mapping. And that's it!

Filter recipients

You can filter contacts that get transferred into PandaDoc documents as recipients based on yes/no fields in a record (aka Boolean fields).

  1. Go to App Launcher, find PandaDoc Setup, and select Configure Recipients

  2. Scroll down to Recipients Filtering

  3. Click Enable Filtering

  4. Choose a field based on which value recipients will be filtered

  5. Choose the value of the field based on which recipients will be filtered: true - yes, false - no.

If you have set up Recipient mapping for Accounts, you can then configure it to pass this Account info (email, phone number, etc) as a recipient to PandaDoc.

For that, go to PandaDoc Setup, then scroll down to Object Customization settings. Next to the Account Object name click Setup, tick the box next to Sending Account as recipient, and click Save.

Note: Salesforce Contact Roles and PandaDoc template roles cannot have 2 contacts assigned to one role.

If you have any suggestions regarding PandaDoc functionalities, please submit an idea on the idea portal or reach out to our Support team.

Passing information from Salesforce into PandaDoc (via fields)

You can pass data into PandaDoc fields similarly to how variables operate. Unlike with variables, however, you don’t need to include square brackets.

In the list of tokens, copy the token without square brackets into Merge field.

Once the document has been sent, the recipient will see the pre-filled data and be able to update this field, provided the field has been assigned to them.

Passing product data into pricing table

Note: The current order of line items in the opportunity is maintained in the pricing table and quote builder block when you create a document from your opportunity or update information in the document using the Refresh data button.

PandaDoc can send Products from an Opportunity, Leads, Contacts, or Account to a pricing table in a document. In this guide, we'll review how to pass Opportunity Products into PandaDoc, but the setup is the same for other objects.

First, map Opportunity product fields to pricing table fields.

  1. Go to PandaDoc Setup, then click on PandaDoc Configure Pricing Items.

  2. Opportunity products will be displayed by default but you can select another object to set up the mapping for.

  3. Next, map Opportunity product fields to pricing table fields and click Save.

  4. Below, under Pricing Items Sorting, you can set up the order in which you want the products listed in the PandaDoc pricing table.

Pass_products_to_pricing_table_0.png

Now, set up the pricing table to accept products from Salesforce.

  1. Open your PandaDoc template and add a pricing table

  2. Data merge will be enabled by default.

That's it for the setup! When you start a new document from an Opportunity (assuming products have been added to it), make sure you select your template.

Products will be added to the pricing table. If certain fields are not displayed, click the plus sign on the right side of the pricing table and select the fields under Add hidden.

Pass custom product fields into pricing table

Sometimes, you need to pass more than the standard set of product fields.

  1. First, add Opportunity product fields into the tokens/variables list by going to PandaDoc Setup > Configure tokens.

  2. Select Opportunity product, and check the fields you need to pass on the right, and they will show up in the tokens list on the left

  3. Click Save. That's it for the setup

  4. Make sure the pricing table in the template has Data merge enabled

  5. When you create a document from the template, click the plus sign on the right side of the pricing table

  6. Select the custom product fields under Add hidden.

If adding custom fields from hidden columns every time you create a document seems like too many clicks, there's a way around that.

  1. Create a document and unhide custom product fields

  2. Then, click the vertical ellipses in the top right corner and select Convert to Template. Your new template will open in a new browser tab

  3. In the template, you can delete the products from the pricing table, but make sure you keep the custom field columns

  4. Next time you start a document from Salesforce, use this template. The columns will be populated with custom product field values.

Pass product data from Salesforce into a quote builder block

Availability: Business* and Enterprise plans
*Quote builder is a part of our CPQ add-on

Note: The current order of line items in the opportunity is maintained in the pricing table and quote builder block when you create a document from your opportunity or update information in the document using the Refresh data button.

You can send product information to a quote builder block from an opportunity in Salesforce. Start by adding a quote builder block to your template, then create a document from an opportunity in Salesforce.

mceclip1.png

Once you’ve created a document using this template, the following product information will be sent to the quote block:

  • Product name

  • Price

  • Quantity

  • Discount

To unhide custom fields in your newly created document, click on the quote builder block, select Edit quote on the floating panel, select Add column at the top right of the section, then select your custom column from the dropdown under Show hidden.

mceclip6.png

Note: If your quote builder block contains several sections, products will be pulled to the last section. If your template contains several quote builder blocks, products from your opportunity will be pulled to each block.

Create and send documents

Now that you've created and set up your template, you can proceed to creating and sending documents from Salesforce.

  1. Go to a record, find the PandaDoc module, and click New Document

  2. Choose a template or select the templates you’d like to bundle, then select Add items and assign recipients to roles, if applicable

  3. Click Continue and check your document: variables, content, recipients list, reminders and Send your document

  4. You can now go back to the record in Salesforce and track your document status

  5. When a document is completed, its .pdf will show up under Files in the record. (Although it is a part of the sync triggers functionality, it's enabled by default when you install the PandaDoc package.)

Add Files in your object view

If you do not see Files in your object, you may need to add it to your object view.

To do this you will need to go back to the Object’s Page Layouts in Salesforce Settings:

  1. Open your Salesforce, in the top right corner, click the gear icon, and select Setup

  2. Go into the Object Manager list and select Opportunity

  3. In the Opportunity, go to Page Layout, and select Opportunity Layout

  4. From the Opportunity Layout page, use the top toolbar to find Related Lists. Next, find Files, drag and drop where needed, then click Save

  5. Double-check your Opportunities to ensure Files can now be seen from the page.

Link a document to an Opportunity in Salesforce

Note: This feature is available for users with a Member, Manager, and Admin role. If you use custom roles make sure to enable “Can view and request integrations” permission for the role to allow users to link documents to Salesforce and import data.

If you have a document created in PandaDoc that you would like to link to an Opportunity in Salesforce, we’ve got you covered!

Click here to learn more.

Update a document with field values from Salesforce

Note: The document must be in the Draft status for this feature.

Note: This feature is available for users with a Member, Manager, and Admin role. If you use custom roles make sure to enable “Can view and request integrations” permission for the role to allow users to link documents to Salesforce and import data.

If the information in a Salesforce record is updated after the document has already been created from this record, you can update the document with the correct values:

  1. In the document, go to the Integrations panel by clicking the Salesforce icon on the left inside the PandaDoc document

  2. Under Document data, select Refresh data

  3. The variables and products in quote builder/pricing table will be updated with the latest information from Salesforce provided the document was created from Opportunity. The list of products in PandaDoc will change based on the addition or removal of opportunity products.​

Note: The current order of line items in the opportunity is maintained in the pricing table and quote builder block when you create a document from your opportunity or update information in the document using the Refresh data button.

You can use the Refresh data feature in any object in Salesforce: Opportunity,

Account, Lead, Contact, or custom objects.

If the field in Salesforce is empty, the corresponding variable won't be refreshed.

Warning: You cannot update PandaDoc fields or role variables.

Troubleshooting steps can be found here.

Did this answer your question?