Use the Salesforce Query Builder

Copy Article URL

Copied

After you connect Mailchimp for Salesforce, use the Query Builder to add leads and contacts to your Mailchimp audience, so you can target them with email or ad campaigns.

In this article, you'll learn how to use the Query Builder for Mailchimp for Salesforce.

Note

This article tells you how to use a Mailchimp for Salesforce integration that was set up before May 1, 2024.

For more information on Mailchimp for Salesforce integrations that were set up on or after May 1, 2024, check out the support options listed at Salesforce Integration by Beaufort 12

Before you start

Here are some things to know before you start this process.

  • Before you use the Query Builder, make sure you successfully connected Mailchimp for Salesforce.
  • To run queries automatically, you'll need to turn on data sync in Mailchimp for Salesforce. Data sync will add new contacts and update contact information in your Mailchimp audience.
  • You can also choose to manually run queries. These will add new or update existing contact information.

About the Query Builder

The Query Builder allows you to pass Salesforce contacts, leads, and campaign members who share specific Salesforce field data into your Mailchimp audience.

You can run a query manually or schedule it to run daily with data sync. You can also choose to manually run queries. These will add new or update existing contact information.

Things to know

  • Salesforce contacts and leads who checked the Email Opt-Out field won't be included in query results.
  • If a lead or contact opts-out in Salesforce after they are added to your Mailchimp audience, they won't be unsubscribed in Mailchimp.
  • To view tags for a Mailchimp audience in Salesforce when you build a query, click Sync Audience next to the Mailchimp audience name in Salesforce.

Create a query

To create a query manually, follow these steps.

  1. Log into your Salesforce account.
  2. Click the App Launcher drop-down menu and choose Mailchimp for Salesforce.
  3. On the Member Queries tab, click New Query. Use the Salesforce Query Builder - 图1
  4. Choose an audience and any interest groups or tags, and click Next.
  5. Select the objects you want to include in the query, and choose your filters for each object.
  6. Click Next. Use the Salesforce Query Builder - 图2
  7. Preview the results of the query. If you need to make changes, click Previous Step. Or, click Next to continue.
  8. Type a name for your query. The default is Audience Name - Today's Date.
  9. If you are an account admin and want a query to run regularly, click the Run daily at drop-down menu and choose a time to run the query. Use the Salesforce Query Builder - 图3
  10. To save your changes and exit, click Save. Click Save and Run to manually run the query.

Schedule and run automatic queries

If you are a Salesforce account admin, you can schedule queries to run at the same hour each day, along with the data sync job.

To schedule a query, follow these steps.

  1. Navigate to the MC Setup tab.
  2. On the Member Queries tab, click Schedule next to the name of the query you want to edit. Use the Salesforce Query Builder - 图4
  3. Click the Run daily at drop-down menu and choose a time to run your query. Use the Salesforce Query Builder - 图5
  4. To save your changes and schedule your query, click Save.

Manually Run a Saved Query

If you prefer to manually run queries you've created, follow these steps.

  1. Navigate to the MC Setup tab.
  2. On the Member Queries tab, click Run Query next to the name of the query you want to run. Use the Salesforce Query Builder - 图6 Each time a query is triggered, we'll check for new leads or contacts that match the query criteria and add them to your Mailchimp audience.

Edit a query

If you need to edit an existing query, follow these steps.

  1. Navigate to the MC Setup tab.
  2. On the Member Queries tab, click Edit next to the name of the query you want to edit. Use the Salesforce Query Builder - 图7
  3. Make your changes to interest groups or tags, and click Next.
  4. Edit the objects included in the query, and choose your filters for each object.
  5. Click Next.
  6. To save your changes and exit, click Save. Click Save and Run to manually run your query.

About Mailchimp for Salesforce

Learn about Mailchimp for Salesforce, a powerful application that syncs your Salesforce and Mailchimp data.


Connect Your Salesforce Account to Mailchimp

Install Mailchimp for Salesforce to sync information between your Mailchimp and Salesforce accounts.


Customize Mailchimp for Salesforce

Customize Mailchimp for Salesforce to quickly view contact activity and email stats. Easily coordinate tasks with other Salesforce users.