Salesforce lookup fields allow you to associate two records in a relationship, enabling you to pull in additional data from related objects, including custom objects, into your PandaDoc templates. This is especially useful when you want to access data beyond the primary object (e.g., pulling Quote data into an Opportunity-based document).
This article walks you through how to create a lookup field in Salesforce, use it to connect two objects, and configure tokens in PandaDoc to use variables from the related object.
What is a lookup field?
A lookup field in Salesforce creates a one-to-many relationship between two objects. It allows you to reference one record from another. For example, you can create a lookup field on the Opportunity object that connects to a Quote object, allowing you to access and use fields from the Quote record in your PandaDoc document templates.
Step 1: Create a lookup field in Salesforce
Navigate to the parent object (the one you want to pull data into).
Example: Go to Setup > Object Manager > Opportunity if you're using Opportunity as your base object.Click Fields & Relationships, then click New.
Select Lookup Relationship and click Next.
Choose the object you want to look up to.
Example: Select Quotes if you want to pull in Quote data.Enter a Field Label (e.g., “Related Quote”), then click Next.
Set the field-level security as needed (or click Next to accept defaults).
Select the Page Layouts where the new field should be displayed and click Next.
Click Save.
You’ll now see the newly created lookup field in your object’s field list.
Step 2: Add the lookup field to your page layout (optional but recommended)
To make it easier to select a related record manually:
In the object (e.g., Opportunity), go to Page Layouts.
Select your layout and drag the newly created lookup field to the desired location.
Save the layout.
Now, when viewing an Opportunity record, you can manually select a related Quote using the lookup field.
Step 3: Link a record using the lookup field
Navigate to a record in your parent object (e.g., an Opportunity).
Find the new lookup field you created (e.g., “Related Quote”).
Select the related record (e.g., choose the appropriate Quote).
Save the record. You may need to refresh the page to see the updated field.
Step 4: Configure PandaDoc tokens using the lookup field
Once your lookup field is set up and records are linked:
In Salesforce, go to PandaDoc Setup > Configure Tokens.
Choose your primary object (e.g., Opportunity).
Locate and select the lookup field you created (e.g., “Related Quote”) in the list.
Scroll down to locate the field and expand it to see available tokens from the related object.
Select the variables you want to use and click Save.
These tokens will now be available for use in your PandaDoc templates when generating documents from the primary object (e.g., Opportunity). They’ll appear in the PandaDoc iFrame embedded in Salesforce.
Example use case
Let’s say you want to generate a proposal from an Opportunity but include pricing or expiration data from a linked Quote record. Using a lookup field and tokens from the Quote object, you can dynamically populate that information in your document template – without needing to duplicate data or manually enter it.
Notes
This setup works with standard and custom objects in Salesforce.
You can only create a lookup from a child to a parent object (one-to-many relationship).
If you don’t see the variables in PandaDoc after linking records, double-check that:
The lookup field is populated in Salesforce.
The correct tokens are enabled in Configure Tokens.
You’re using the correct base object for your document generation workflow.