> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monumint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce Audience

> Choose which Salesforce records sync into Monumint.

![Lead Query card with a SOQL query on the Contact object and a preview of the results](https://mintcdn.com/omniai/5EsVoTZnq-v8uzi1/images/integrations/salesforce/lead-query.png?fit=max\&auto=format\&n=5EsVoTZnq-v8uzi1\&q=85\&s=97355db4aef7093e404f9ae5bfba10a8)

Your audience is defined by a SOQL query that Monumint runs every 10 minutes. Each row the query returns becomes one lead in Monumint.

## Return one row per person

Monumint treats every row as a separate lead, so a person who appears twice gets contacted twice. Base the query on the **Contact** or **Lead** object, where each person has exactly one record. Avoid starting from Opportunity, Account, or a custom application object, because those can have many rows for the same person.

To include data from a related record, read it through a parent relationship such as `Account.Name` or `Owner.Email`. Parent relationships never add rows.

## Recommended query

```sql theme={null}
SELECT Id, FirstName, LastName, Email, MobilePhone, Account.Name, Owner.Email,
       Monumint_Agent_Active__c, CreatedDate, LastModifiedDate
FROM Contact
WHERE (Email != null OR MobilePhone != null)
  AND LastModifiedDate = LAST_N_DAYS:90
```

If you sync Leads, query `FROM Lead`, use `Company` in place of `Account.Name`, and add `IsConverted = false` so a converted lead and its contact are not both synced.

Keep these rules in mind as you adjust the query:

* Always select `Id`. Monumint uses it to match each row to the same lead on every sync.
* Select every field you plan to map or filter on.
* Keep the agent on/off condition out of the `WHERE` clause. Records that drop out of the query stop syncing, so Monumint can never hand them back to your team. Use [Agent Active](https://docs.monumint.com/integrations/salesforce/agent-active.md) instead.

## Test and save

Click **Test query** to see the record count and a preview of the first 50 rows. Check that nobody appears twice, then click **Save**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.