You can use the Salesforce Pardot to send job results (in the form of prospects or list memberships) from Treasure Data directly to Salesforce Pardot to sync up your CRM data.
Pardot offers marketing automation to help marketing and sales teams find and nurture leads, close more deals, and maximize ROI.
- Basic Knowledge of Treasure Data.
- Basic knowledge of Salesforce Pardot models
- A working Salesforce Pardot account
- Your Business Unit ID.
We support sending data to Prospect or List Memberships in Salesforce Pardot.
We support parallel prospects upsert. Use this feature whenever you would like to speed up the execution of your jobs by increasing the number of parallel tasks. But please be aware of your account's concurrent call limit.
Customers need an adequate Salesforce Pardot plan (Pro or Ultimate) to use the connector.
For Prospects, due to the API, Treasure Data only supports a URI length to a certain length, then we add a restriction if a row contains data that is greater than 7500 characters in length (after serialized as JSON) will be considered an invalid record.
For List Membership, opting out of prospects is not supported because it is a one-way action and can not be reverted.
The connector adheres to all Pardot API limits below:
- The daily Pardot API call limit and the concurrent Pardot API call limit apply to Import API calls just as they would any other Pardot API calls.
Column names in your export results must be in a lower letter case and strictly follow the Pardot field names of each data object (case sensitivity).
To find the Pardot Business Unit ID, use Setup in Salesforce. Your Pardot Business Unit ID begins with "0Uv" and is 18 characters long.
If you cannot access the Pardot Account Setup information, ask your Salesforce Administrator to provide you with the Pardot Business Unit ID. https://developer.pardot.com/kb/authentication/.
Authenticating with Pardot requires entering your Business Unit ID.
Log into Salesforce using the same account you use to log into Pardot.
Navigate to Setup > Pardot > Pardot Account Setup. OR, from Setup, enter "Pardot Account Setup" in the Quick Find box.

You may have multiple Pardot business units. Your Pardot Business Unit ID begins with "0Uv" and is 18 characters long.
A custom connected app, the correct authorization, and the refresh token are all required to define your Pardot authorization within Treasure Data.
See the Using your Custom Connected App instruction at the end of this HTML page.
On TD Console, you must create and configure the data connection before running your query. As part of the data connection, you provide authentication to access the integration following the below steps

- Open TD Console.
- Navigate to Integrations Hub > Catalog.
- Search for and select Salesforce Pardot.
- Select Create Authentication, and provide the credential information for the integration as described below.
- Select Continue, enter a name for the Authentication, and select Done.
| Field | Description |
|---|---|
| Pardot Host | If you are using a Production account it would be https://pi.pardot.com. For a Pardot Developer Org or a Sandbox account, it would be https://pi.demo.pardot.com |
| Pardot Business ID | The Pardot Business Unit ID |
| Connected App |
|
| OAuth connection | For the Treasure Data Connected App, select Click here and follow the authorization flow to provide your OAuth. You may need to navigate to the Integrations Hub Catalog and search for the Salesforce Pardot to continue. |
| Client ID | For the Custom Connected App, refer here to create a Connected App and fill in the Client ID, Client Secret, Login URL, and Refresh Token in the corresponding fields |
| Client Secret | The Client Secret of your Connected App |
| Login URL | The login URL of your Salesforce instance |
| Refresh token | The refresh token after authorizing the custom app |
The TD Console supports multiple ways to export data. Please follow the below steps to export data from the Data Workbench
- Navigate to Data Workbench > Queries
- Select New Query, and define your query
- Select Export Results to configure the data exporting
- Select an existing Pardot authentication, or create a new one following the above section
- Configure the exporting parameters as described below, and select Done

| Field | Description |
|---|---|
| Data Objects | Select the target data object between Prospects (default) and List Memberships |
| Data Objects = Prospects | |
| Prospect List Operation | The default upload mode is Batch Upsert |
| List ID | The List ID that Prospects will be added (or removed) into. It could be a single List ID or comma-separated string of List ID |
| Prospect List Operation | Select Add or Remove to add (or remove) Prospects in (out of) the List ID specified |
| Data Objects = List Memberships | |
| List Memberships Operation | Select Upsert or Delete. The respective operation will be used as your selection |
| Column Name | Data Type | Required? | Description | Note |
|---|---|---|---|---|
| id | Integer | ✅ | Pardot ID for this prospect | should be left null in case of inserting new prospects |
| fid | String | ✅ | CRM FID if syncing with Salesforce Leads | should be left null in case of inserting new prospects |
| String | ✅ | Prospect's email address | always required in case of inserting new prospects | |
| campaign_id | Integer | Pardot ID of the campaign associated with this prospect | ||
| salutation | String | Prospect's formal prefix | ||
| first_name | String | Prospect's first name | ||
| last_name | String | Prospect's last name | ||
| password | String | Prospect's password | ||
| company | String | Prospect's company | ||
| prospect_account_id | Integer | Prospect's account ID | ||
| website | String | Prospect's website URL | ||
| job_title | String | Prospect's job title | ||
| department | String | Prospect's department | ||
| country | String | Prospect's country | ||
| address_one | String | Prospect's address, line 1 | ||
| address_two | String | Prospect's address, line 2 | ||
| city | String | Prospect's city | ||
| state | String | Prospect's US state | ||
| territory | String | Prospect's territory | ||
| zip | String | Prospect's postal code | ||
| phone | String | Prospect's phone number | ||
| fax | String | Prospect's fax number | ||
| source | String | Prospect's source | ||
| annual_revenue | String | Prospect's annual revenue | ||
| employees | String | Prospect's number of employees | ||
| industry | String | Prospect's industry | ||
| years_in_business | String | Prospect's number of years in business | ||
| comments | String | Comments about this prospect | ||
| notes | String | Notes about this prospect | ||
| score | Integer | Prospect's score | ||
| is_do_not_email | Boolean | If the value is 1, the prospect prefers not to be emailed | ||
| is_do_not_call | Boolean | If the value is 1, the prospect prefers not to be called | ||
| is_reviewed | Boolean | If the value is 1, the prospect has been reviewed | ||
| is_starred | Boolean | If the value is 1, the prospect has been starred | ||
| is_archived | Boolean | If the value is 1, the prospect has been archived |
Sample query
- Upsert a prospect to a list_xxx
SELECT
'xxx' as id
FROM
prospect_table
-- Or
SELECT
email
FROM
prospect_table| Column Name | Data Type | Description | Required? |
|---|---|---|---|
| prospect_id | Integer | Prospect's ID | ✅ |
| list_id | Integer | List's ID | ✅ |
Sample query
SELECT
list_id,
prospect_id
FROM (VALUES (xxx, yyyy)) AS table1(list_id, prospect_id);| Parameter | Values | Description |
|---|---|---|
| client_id | xxxx | Your connected app's consumer key |
| client_secret | xxxx | Your connected app's secret key |
| refresh_token | xxxx | Your refresh token obtained after authorizing your connected app |
| login_url | https://login.salesforce.com/ | Your Salesforce's login URL |
| pardot_domain | https://pi.pardot.com | Your Pardot's domain |
| business_unit | 0Uv4xxxxx | Your Business Unit Id |
| data_object | prospects | Your target data object must be either prospects or list_memberships |
| skip_invalid_records | true | Set this value to true if you would like to skip failed record |
| prospect_operation | sync | The operation to send prospects data to Pardot, sync is supported |
| prospect_lists | xxxx | Comma separate of prospect list ids in case data_object = prospects (string) |
| prospect_list_operation | add | Operation to add/remove prospects if prospect_lists is set. Applicable in case data_object = prospects (enum(add, remove), default: add) |
| upsert_by_email | false | Upsert propsect using email as key |
| parallel_tasks | 1 | Number of tasks to run in parallel when sending prospects data to Pardot |
| max_payload | 5000 | Payload size when sending prospects data to Pardot. This is a parameter for fine-tuning for each Pardot instance, they will have a different max URI configured. Whenever you reach the error 414 Request-URI Too Long when sending prospects then please lower this value. Otherwise, the default value is enough. |
| list_membership_operation | upsert | The operation to send list memberships data to Pardot. Must be upsert or delete |
| maximum_retries | 5 | Maximum number of retries when request failed |
| initial_retry_wait | 1 | The initial amount of time before the first retry in seconds |
| maximum_retry_wait | 120 | The maximum amount of time to wait for a retry in seconds |
| maximum_connection_timeout | 300 | Maximum connection time for a request to Pardot |
You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.
Treasure Data's scheduler feature supports periodic query execution to achieve high availability.
When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored.
For example, if the cron schedule is '0 0 1 * 1', then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed.
Navigate to Data Workbench > Queries
Create a new query or select an existing query.
Next to Schedule, select None.

In the drop-down, select one of the following schedule options:

Drop-down Value Description Custom cron... Review Custom cron... details. @daily (midnight) Run once a day at midnight (00:00 am) in the specified time zone. @hourly (:00) Run every hour at 00 minutes. None No schedule.

| Cron Value | Description |
|---|---|
0 * * * * | Run once an hour. |
0 0 * * * | Run once a day at midnight. |
0 0 1 * * | Run once a month at midnight on the morning of the first day of the month. |
| "" | Create a job that has no scheduled run time. |
* * * * *
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +---------- month (1 - 12)
| | +--------------- day of month (1 - 31)
| +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)The following named entries can be used:
- Day of Week: sun, mon, tue, wed, thu, fri, sat.
- Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.
A single space is required between each field. The values for each field can be composed of:
| Field Value | Example | Example Description |
|---|---|---|
| A single value, within the limits displayed above for each field. | ||
A wildcard '*' to indicate no restriction based on the field. | '0 0 1 * *' | Configures the schedule to run at midnight (00:00) on the first day of each month. |
A range '2-5', indicating the range of accepted values for the field. | '0 0 1-10 * *' | Configures the schedule to run at midnight (00:00) on the first 10 days of each month. |
A list of comma-separated values '2,3,4,5', indicating the list of accepted values for the field. | 0 0 1,11,21 * *' | Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month. |
A periodicity indicator '*/5' to express how often based on the field's valid range of values a schedule is allowed to run. | '30 */2 1 * *' | Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. '0 0 */5 * *' configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month. |
A comma-separated list of any of the above except the '*' wildcard is also supported '2,*/5,8-10'. | '0 0 5,*/10,25 * *' | Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month. |
- (Optional) You can delay the start time of a query by enabling the Delay execution.
Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically exported to the specified destination.
Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.
(Optional) You can delay the start time of a query by enabling the Delay execution.
You can also send segment data to the target platform by creating an activation in the Audience Studio.
- Navigate to Audience Studio.
- Select a parent segment.
- Open the target segment, right-mouse click, and then select Create Activation.
- In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
- Customize the activation output in the Output Mapping panel.

- Attribute Columns
- Select Export All Columns to export all columns without making any changes.
- Select + Add Columns to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select + Add Columnsto add new columns for your activation output.
- String Builder
- + Add string to create strings for export. Select from the following values:
- String: Choose any value; use text to create a custom value.
- Timestamp: The date and time of the export.
- Segment Id: The segment ID number.
- Segment Name: The segment name.
- Audience Id: The parent segment number.
- + Add string to create strings for export. Select from the following values:
- Set a Schedule.

- Select the values to define your schedule and optionally include email notifications.
- Select Create.
If you need to create an activation for a batch journey, review Creating a Batch Journey Activation.
- You can use Scheduled Job with Result Export to periodically upload data to a target destination
- You can involve this integration in a TD workflow as part of a more advanced data pipeline
A Connected App is required to integrate into your Pardot account. TD has prepared a Connected App for your convenience, but you could create one for the purpose. If you use a custom domain name for your Salesforce instances or your login URL is not https://login.salesforce.com, then a Custom Connected App is required.
Login to your Salesforce Lightning Experience.
Select the
gearicon.Select Setup.

Navigate to Platform Tools > Apps.
Select App Manager.

- Select on New Connected App.

- Type the required information in Basic information

- Select Enable OAuth Settings.

- Navigate to Callback URL and type http://localhost:8080
- Navigate to Selected OAuth Scopes, and select
Access Pardot services (pardot_api)andPerform requests on your behalf at any time (refresh_token, offline_access). - Scroll to the end, select Save and select Continue
- Select Copy to copy the
Consumer Keyand theConsumer Secret, which will be used forClient IDandClient Secretrespectively.
- Open a web browser and type in the following:
https://{YOUR_SALESFORCE_LOGIN_URL}/services/oauth2/authorize?client_id={YOUR_CONSUMER_KEY}&redirect_uri=http://localhost:8080&response_type=code
- YOUR_SALESFORCE_LOGIN_URL: {Your salesforce login url - i.e https://login.salesforce.com}
- YOUR_CONSUMER_KEY: {The consumer key you got in create connected app step}
An example of a full URL: https://login.salesforce.com/services/oauth2/authorize?client_id=xxxxxx&redirect_uri=http://localhost:8080&response_type=code
- Log in to your account, and select Allow

- You will be redirected to a non-existing page, let select the URL and copy the text after code= and replace %3D with =
For example, in the URL http://localhost:8080/?code=xxxx%3D%3D, the **xxxx==**is the code to get a refresh token in the next step.
Use CURL in a terminal with the code from the step above to request a refresh token
curl --request POST \
'https://{your_salesforce_login_url}/services/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=your_code' \
--data-urlencode 'client_id=client_id' \
--data-urlencode 'client_secret=client_secret' \
--data-urlencode 'redirect_uri=http://localhost:8080'After sending the request you will receive a response like below
{
"access_token": "xxxxx",
"refresh_token": "xxxx",
"signature": "xxxx",
"scope": "refresh_token pardot_api",
"instance_url": "xxxx",
"id": "xxx",
"token_type": "Bearer",
"issued_at": "1616662486135"
}The value in refresh_token is your Refresh Token used in the Authentication screen.