How to Use Custom Object Fields in Pardot HML

By Lucy Mazalon

Pardot HML enables you to easily add personalization because it dynamically pulls in data specific to the prospect that is viewing your Pardot (Account Engagement) marketing assets. This includes email, dynamic content, landing pages, forms, and user email signatures.

You may already know that it’s easy to select a merge field from the Pardot (Account Engagement) merge picker, including prospect (Lead/Contact) fields, user fields, and organization-level fields (such as your mailing address). But for your next campaign, you may want to take HML further. Personalization based on custom object data isn’t available out-of-the-box. For example, you may like to insert the name of the product the prospect has just purchased, or the date when their onboarding process will start.

It’s not easy – but it’s not impossible. You have to find a way to sync the field data from the custom object to the prospect object, which is possible using two possible workarounds.

Note: Before you continue, make sure to check that this is now not native functionality. The rate that the Pardot (Account Engagement) product is developing means that these workarounds may not be necessary.

Option 1: Lead or Contact Formula Field to Prospect Field

For this first workaround, we’re going to create a formula field on the Lead or Contact objects* that will reference your custom object field. The data in the custom object field will appear as read-only text in the Lead/Contact formula field when synced to Pardot/.

*Note: Take a moment to think about your Salesforce data model. In 99% of the cases, the related object you want to pull data from will be related to either the Lead or the Contact, not both. Hopefully, it will be obvious but is certainly worth checking. If it is applicable to only one object, then you will need to segment your Pardot (Account Engagement) lists appropriately before sending using the ‘Prospect CRM status’ filter (which will only include prospects who are Leads, or prospect who are Contacts, depending on your selection).

READ MORE: Formula Fields + Pardot: The Problem and How to Solve It

Once we have the data on the Lead/Contact, we can map the field to a Pardot (Account Engagement) prospect custom field. Here is how your field data will move around:

  1. Data starts in the custom object field (Salesforce).
  2. Goes to a Lead or Contact formula field (Salesforce).
  3. Syncs to a prospect custom field (Pardot).

Step 1: Create a formula field

Create a formula field on the Lead or Contact object that pulls the field data from the custom object. The output type will be ‘text’:

For example, I have a project custom object that has a field “start date”. I want to pull the start date into an email, so this formula field below will pull that start date in from the project the contact is related to.

Step 2: Map formula field to Pardot

Create a new prospect custom field in Pardot (text), and map it to the Salesforce formula field. That custom prospect field will be available to use from the Pardot (Account Engagement) merge picker.


  1. Clue yourself up on what triggers the Pardot/Salesforce sync. Changes to formula fields do not trigger the connector sync, so if you decide to use this method be aware of how your data is being updated. It’s worth running a data check before sending an email (by using dynamic lists or exporting to CSV to check the field data).
  2. What are the data relationships that are impacting that field? For example, can a contact be related to more than one project in Salesforce? What happens then? Which should Salesforce (and Pardot) take as the truth? (In this use case, it would be the most recently created project, or the project with the earliest start date.)
READ MORE: How Do Pardot and Salesforce Work Together?

Ensure you think these points through carefully (or seek the advice of a Pardot expert) before implementing this workaround.

Option 2: Pardot Custom Object to Prospect Field

For the second workaround, we’re going to use Pardot custom objects and transform the data from the custom object record to the prospect record. Note that you must have Pardot Advanced edition, or have the custom object add-on.

READ MORE: Guide to Pardot Custom Objects – What You Can and Can’t Do

You can pull custom object data directly from Salesforce into a Pardot custom object, but it’s a one-way sync, and it’s read-only. If you can get the data into a prospect custom field, then we are good to go!

  1. Data starts in the custom object field (Salesforce).
  2. Syncs to a custom object field, read-only (Pardot).
  3. Inserted into a prospect custom field (Pardot).

How do you insert the data into a prospect field from a custom object field? You can use an automation rule to say ‘when prospect custom object field is [ ], then set prospect custom field to [ ]’.


Unlike Salesforce formula fields, Pardot (Account Engagement) automation rules require you to define the exact value that the automation rule needs to insert into the target field. You can see that this would work for picklist/dropdown values, where there is a defined set of possible values. The potential upkeep is why experts would recommend option 1.

However, a plus point. In cases where the processing limits on the Salesforce side are already stretched, to avoid exceeding the governor limits (and stressing out your admin) this solution means you can keep it within Pardot and have control over it.


If you want to take HML further and add personalization based on custom object data, you can see that it’s not easy, but it’s not impossible. When you open the Pardot merge picker, you won’t see custom object fields, and so the trick is to get the custom object data into the prospect fields using one of the two workarounds in this post.

READ MORE: 4 HML Tricks for Advanced Pardot Personalization

The Author

Lucy Mazalon

Lucy is the Operations Director at Salesforce Ben. She is a 10x certified Marketing Champion and founder of The DRIP.

Leave a Reply