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

# Map Salesforce fields

> Map Salesforce fields to Spotzee contact properties and configure email opt-out sync.

Field mapping decides which Salesforce data lands on which Spotzee user property. The integration ships with sensible defaults for the standard email-and-name fields. You add more mappings for the custom fields that matter to your campaigns.

> [!NOTE]
>
> Field mappings are configured per integration. Open the integration from **Integrations** → **Salesforce** and use the **Field mappings** section in its configuration view.

## Default mappings

When you first open field mapping, Spotzee pre-populates these mappings for fields available on the selected Salesforce objects:

| Salesforce field | Spotzee property |
| - | - |
| `Email` | `email` |
| `FirstName` | `first_name` |
| `LastName` | `last_name` |
| `Phone` | `phone` |

You can change defaults or add more rows. Defaults are a starting point, not a constraint.

## Add a mapping

**1. Open Field mappings**

In the integration's configuration view, scroll to the **Field mappings** section.

**2. Pick a Salesforce field**

The Salesforce field dropdown lists every field on the objects you're syncing. Standard fields appear first, custom fields after.

**3. Pick or create a Spotzee property**

The Spotzee property dropdown shows existing properties. Pick one to map onto an existing property, or type a new name and pick **Create "your\_property\_name"** to create one on the fly.

**4. Add more rows or save**

Choose **Add mapping** to add another row, or save when done.

New properties created from the mapping screen default to `string` type. Adjust the type later under **Settings** → **Data Schema** if you need numeric, date, or boolean handling.

## Type compatibility

Spotzee copies mapped values as Salesforce returns them, with one explicit conversion:

| Salesforce value | Saved value |
| - | - |
| `MultiPicklist` | An array split on semicolons |
| Other mapped values | The value returned by Salesforce |
| `null` | Clears the mapped property |

Check the destination property's type in **Settings** → **Data Schema** before mapping values that need a specific format.

## Sync email opt-out

Salesforce tracks email opt-out via the `HasOptedOutOfEmail` boolean field on Lead and Contact records. Choose it in the separate **Email opt-out field** setting. A regular field mapping does not update subscription state.

**1. Choose the opt-out field**

In **Email opt-out field**, select `HasOptedOutOfEmail` or another available Salesforce boolean field.

**2. Save**

Save. Spotzee re-evaluates the selected field for all matching records on the next sync.

How it lands in Spotzee:

* `True` in Salesforce opts the contact out of the project's email subscriptions.
* `False` removes that email opt-out.

Spotzee re-checks changed records on incremental syncs. Changing the opt-out setting triggers a full resync.

### One-way sync caveat

The opt-out sync only flows from Salesforce **into** Spotzee. If a user unsubscribes via a Spotzee email link or preference centre, that change stays in Spotzee and isn't pushed back to Salesforce.

To keep both systems aligned, either:

* **Treat Salesforce as the source of truth** and only opt users out from Salesforce.
* **Build a manual reconciliation** to update Salesforce when a Spotzee unsubscribe happens (separate webhook integration or scheduled job, neither shipped by Spotzee).

### CampaignMember and opt-out

`HasOptedOutOfEmail` belongs to Lead and Contact, not CampaignMember. To sync that field, include the relevant Lead or Contact object in the integration.

## Test a mapping

After saving a new mapping, run a manual sync from the integration's overview page. Open one of the imported users in Spotzee and verify the mapped fields show the values you expect from Salesforce. Adjust if anything looks off.

## Next steps

> [card] [Operations](https://spotzee.com/docs/guides/salesforce/operations.md)
>
> Manual sync, frequency, and monitoring health.

> [card] [Define custom user attributes](https://spotzee.com/docs/guides/data-schema.md)
>
> Set the type and visibility on the new properties you just created.

> [card] [Subscription preferences](https://spotzee.com/docs/guides/subscription-preferences.md)
>
> Review email subscription types and per-contact states.

> [card] [Salesforce overview](https://spotzee.com/docs/guides/salesforce/overview.md)
>
> What the integration does and what data flows.


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