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

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 immediately or schedule it to run daily. Each time it runs, the query will update existing subscribers and add new subscribers.

Things to Know

  • Salesforce contacts and leads who checked the Email Opt-Out field won’t be included in query results.
  • Contact or lead field information that is mapped with a MailChimp list field will overwrite the existing MailChimp list field information. This means that when you run a query, any changes to contacts or leads in Salesforce will be used to update the subscribers in MailChimp.
  • If a lead or contact opts-out in Salesforce after they are added to a MailChimp list, they won’t be unsubscribed in MailChimp.

Create a Query

To create a query, follow these steps.

  1. Log into your Salesforce account.
  2. Click the Apps drop-down menu and choose MailChimp for Salesforce.
  3. Click MC Setup.
  4. In MailChimp Member Queries, click New Query.
    Cursor selects the New Query button.
  5. Choose a list and any interest groups or segments, and click Next Step.
  6. Select the objects you want to include in the query, and choose your filters for each object.
  7. Click Next Step.
    Shot of objects selected, with cursor clicking Next Step.
  8. Preview the results of the query. If you need to make changes, click Previous Steps. Or, click Next Step to continue.
  9. Type a name for your query. The default is List Name - Today's Date.
  10. 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.
  11. To save your changes and exit, click Save. Click Save & Run to save your changes and run the query immediately.

Schedule and Run 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. In MailChimp Member Queries, 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 exit, click Save. Click Save & Run to save your changes and run the query immediately.

Manually Run a Query

If you pefer to manually run queries, follow these steps.

  1. Navigate to the MC Setup tab.
  2. In  MailChimp Member Queries, 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. In MailChimp Member Queries, 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 Step.
  4. Edit the objects included in the query, and choose your filters for each object.
  5. Click Next Step.
  6. To save your changes and exit, click Save. Click Save & Run to save your changes and run the query immediately.

Was this article helpful?
What can we do to improve articles like this?