Guides / n8n × Pipedrive / Field Mapping

Fix n8n + Pipedrive Person Email/Phone Saved as [object Object] or Ignored

Pipedrive's Persons API expects email and phone as an array of objects with value, primary, and label. Sending a plain string, or letting n8n stringify an object, saves [object Object] or drops the value. Build the array explicitly.

Comparison graphic showing a plain email string stored as [object Object] versus the array-of-objects shape (value, primary, label) Pipedrive expects from n8n.
After creating or updating a Pipedrive person from n8n, the email or phone shows as [object Object], is blank, or only the first of several values is saved.
Short answer: Pipedrive stores a person's email and phone as an array of objects, each shaped { value, primary, label }. If n8n sends a bare string, the field can be rejected or stored oddly; if a JavaScript object is passed where the API expects the array and it gets stringified, Pipedrive saves the literal text [object Object]. The fix is to construct the array yourself — one object per address or number, exactly one marked primary: true, and a label such as work or home — and send that array on the email and phone fields.

The exact shape Pipedrive wants

In Pipedrive's Persons API, email and phone are not scalar fields. Each is an array. Every element is an object with three keys: value (the actual address or number, as a string), primary (a boolean; exactly one element in the array should be true), and label (a short string like work, home, or mobile).

So a person with one work email is sent as email: [ { value: 'a@b.com', primary: true, label: 'work' } ]. A person with a work and a personal email is a two-element array with primary: true on one of them.

This applies to both create (Add a person) and update. On update, sending the array replaces the whole email or phone set for that person, so include every address you want to keep, not just the new one.

email and phone are arrays of { value, primary, label } objects. One element must be primary. Sending a plain string or a single object instead of the array is the root of every symptom here.

Why you see [object Object] or a dropped value

If an n8n expression yields a JavaScript object and that gets placed where Pipedrive expects the array, the HTTP serialisation can turn the object into its string form, which is the literal text [object Object]. Pipedrive stores that text as the email value. This is the classic symptom and it means 'an object was stringified somewhere in the mapping'.

If you send a bare string ('a@b.com') for email, Pipedrive may reject the request or fail to attach it as a proper contact method, so the field looks empty afterward.

If you build the array but forget primary, or set primary: true on more than one element, Pipedrive can keep only one entry or reorder them unexpectedly, which shows up as 'only the first value saved'.

  • [object Object] stored → an object was stringified instead of sent as the array.
  • Field blank after write → a bare string was sent instead of the array.
  • Only one value kept → primary missing, or set on multiple elements.

What not to do

Do not JSON.stringify the array yourself and paste the string into the field. Pipedrive wants the actual array in the request body, not a string that looks like an array.

Do not try to set email through a custom field to sidestep the format. The person email and phone are standard contact fields with their own storage; a custom text field is not the same thing and breaks Pipedrive features that use the real fields.

Do not send only the new email on an update and expect Pipedrive to merge it with the existing ones. Update replaces the set; you must include the addresses you want to keep.

The fix: build the array in a Code or Set node

Add a Code node before the Pipedrive node that assembles email and phone as proper arrays from your source data. For each address or number, output an object with value as a string, a primary boolean, and a label. Guarantee exactly one primary per array — mark the first element primary and the rest not, unless your source specifies which is primary.

For updates, first read the person's current email and phone arrays, merge in the new values (de-duplicating by value), decide which one is primary, and send the full merged array.

If you are calling Pipedrive with an HTTP Request node instead of the built-in node, put the arrays directly in the JSON body. If you are using the built-in Pipedrive node and it only offers a single email string field, use the HTTP Request node for this call so you can send the array shape the API actually requires.

// n8n Code node: build Pipedrive-shaped contact arrays
function contactArray(values, label) {
  const list = (Array.isArray(values) ? values : [values]).filter(Boolean).map(v => String(v).trim());
  return list.map((value, i) => ({ value, primary: i === 0, label }));
}

const body = {
  name: $json.fullName,
  email: contactArray($json.emails, 'work'),   // -> [ { value:'a@b.com', primary:true, label:'work' } ]
  phone: contactArray($json.phones, 'work'),
};
return [{ json: body }];

// POST https://<company>.pipedrive.com/api/v2/persons   (x-api-token header)
// body as above — email/phone are arrays, not strings

Verification

Create a test person with one email and one phone. Open the person in Pipedrive: the email and phone should show the real values, each marked as primary, with the label you set — not [object Object] and not blank.

Create a second test person with two emails. Confirm both appear, exactly one is primary, and the order is what you intended.

Run an update that adds a third email to an existing person. Confirm the person ends up with all the emails you sent in the merged array, and that any address you left out of the array is gone — which proves update replaces rather than merges, so your merge logic is doing the right thing.

  • Single email/phone stores the real value with a primary flag and label.
  • Multiple values all appear, with exactly one primary.
  • Update replaces the set — the array you send is the final state.

Update replaces the array: the read-merge-write pattern

Because an update overwrites the whole email or phone set, any workflow that adds an address has to read the current one first. Skipping that read is how a sync quietly deletes the customer's only working phone number: the workflow sends the one value it knows about, Pipedrive replaces the array with it, and nothing in the response indicates that two other numbers just disappeared.

The merge itself needs three rules. De-duplicate on a normalised form of the value, not the raw string, or "A@Example.com" and "a@example.com" both survive as separate entries. Preserve the existing primary unless you have a reason to move it, because primary drives which address Pipedrive uses for email sync and for merge-field rendering. And cap the result: a runaway sync that appends on every run builds person records with dozens of near-identical addresses, which is worse than the original problem and far harder to clean up.

The code below is the whole pattern in one Code node. It takes the person's current array and the incoming values, normalises, merges, and returns an array that is safe to send as the full replacement.

// n8n Code node — merge new contact values into the existing array
const existing = $json.currentPerson.emails || [];      // from GET /api/v2/persons/{id}
const incoming = [].concat($json.newEmails || []);

const norm = (v) => String(v).trim().toLowerCase();
const seen = new Map();

for (const e of existing) seen.set(norm(e.value), { ...e });
for (const v of incoming.filter(Boolean)) {
  const k = norm(v);
  if (!seen.has(k)) seen.set(k, { value: String(v).trim(), primary: false, label: "work" });
}

const merged = [...seen.values()].slice(0, 10);
if (!merged.some((e) => e.primary) && merged.length) merged[0].primary = true;

return [{ json: { emails: merged } }];

// PATCH /api/v2/persons/456  { "emails": merged }
// The array you send becomes the complete set — anything omitted is deleted.

Primary sources and reports

Pipedrive's Persons API reference documents email and phone as arrays of objects with value, primary, and label. Pipedrive Developers' Community threads document the [object Object] symptom when the array is not built correctly, and the correct multi-value format for create and update. n8n's Pipedrive node documentation covers the person operations.

Frequently asked questions

Why does my Pipedrive person's email show as [object Object]?

An n8n expression produced a JavaScript object that was stringified when it should have been sent as an array of { value, primary, label } objects. Build the array explicitly in a Code node and send that.

Can I just send email as a plain string?

No. Pipedrive's Persons API expects email and phone as arrays of objects. A bare string is rejected or fails to attach as a proper contact method, leaving the field blank.

Does updating a person add to the existing emails or replace them?

It replaces the whole array. To keep existing addresses, read them first, merge in the new ones (de-duplicating by value), pick the primary, and send the full merged array.

The built-in Pipedrive node only has one email field — what do I do?

Use an HTTP Request node for the create/update call so you can send email and phone as the array-of-objects shape the API requires, with exactly one element marked primary.

My sync deleted phone numbers nobody touched.

An update replaces the whole array rather than merging into it. Read the person's current emails and phones, merge your new values into that array, and send the complete set — anything you omit is removed.