Use the MailChimp for Salesforce Query Builder

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

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

Before You Start

  • 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 list.
  • You can also choose to manually run queries. These will add new contacts to your MailChimp list, but won't 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 a MailChimp list. 

You can run a query manually or schedule it to run daily with data sync. Note that only queries run automatically with data sync will update existing contact information. Queries run manually will add new contacts to your MailChimp list, but won't 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 a MailChimp list, they won't be unsubscribed in MailChimp.
  • To view segments for a MailChimp list in Salesforce when you build a query, click Sync List next to MailChimp list 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.
    Cursor selects the New Query button.
  4. Choose a list and any interest groups or segments, and click Next.
  5. Select the objects you want to include in the query, and choose your filters for each object.
  6. Click Next.
    Shot of objects selected, with cursor clicking Next Step.
  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 List 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.
    Screen of query being named and time to run selected.
  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.
    Cursor clicks the Schedule option in the MailChimp Member Queries section.
  3. Click the Run daily at drop-down menu and choose a time to run your query.
    Example of MC Query Name filled in and Run Daily At time selected from the drop-down menu.
  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. Manual queries will add new contacts to your MailChimp list, but won't update existing contact information.

  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.
    Cursor clicks Run Query in the MailChimp Member Queries section.
    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 list.

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.
  3. Make your changes to interest groups or segments, 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.

Was this article helpful?
Anything else we can do to improve our site?

Technical Support