# CRM field mapping

> How HubSpot, Attio and Pipedrive match submissions by email, map form fields to CRM fields, and avoid duplicate notes.

[HubSpot](https://ikiform.com/docs/integrations/hubspot.md), [Attio](https://ikiform.com/docs/integrations/attio.md) and [Pipedrive](https://ikiform.com/docs/integrations/pipedrive.md) work the same way. Each submission is matched to a contact or person by email address: if one exists, it's updated, otherwise a new one is created. Every submission is also saved as a note on the record, with every field, a link to the submission in Ikiform and the line `Ikiform submission <id>`.

## Field mapping

Choose **Field mapping** on the card to decide which form field fills which CRM field. Common field names are mapped for you: email, first name, last name, full name, phone, company, website, job title and message, including variations like `your_email`, `surname` or `mobile`. A full name is split into first and last name. Set a field to **Don't map** to keep it only in the note.

- **Also set** writes a fixed value to one more field, such as a source field set to `Website`. It's only written when the field is empty, so it never overwrites what your team entered.
- Each CRM adds its own setting: the lifecycle stage in HubSpot, a list in Attio, and a lead label, owner and source channel in Pipedrive.
- Fields the form hasn't received yet are mapped automatically when they first arrive, if their names are recognised.

## Submissions without an email

A CRM record needs an email address to be matched. If a submission has no mapped email, the run fails with a message asking you to map an email field, and nothing is written. Map the field, then use **Retry** or **Replay failed**.

## Duplicates

Before a retry adds a note, Ikiform looks for a note with the line `Ikiform submission <id>` on the record. If it's already there, the run counts as sent, so a retry never adds a second note. Keep that line in the note for this to work.

If a mapped field is deleted in the CRM, runs fail with a message naming the field until you fix the mapping.

## Send a test

**Send test** creates or updates a record for `ada@example.com`, using your field mapping, with a note titled **Test from Ikiform**. Pipedrive also adds a lead. Delete test records whenever you like.
