Supply Lens

Create Pipedrive deals from orders

Lesson 29 of 30 8 min read

Place each order's deal in the right pipeline and stage, link it to the right organisation and contact, and fill custom fields, products and a link back to the source record.

With Pipedrive, Supply Lens writes to the CRM. When an order (or a quote) is created in the back office, typically Unleashed, Supply Lens creates a Pipedrive deal for it, linked to the right organisation and person, with the details sales care about. This lesson covers creating the deal. The next covers what happens as the order progresses.

By the end of this lesson you'll be able to configure where Pipedrive deals land, how customers are found, and what data goes on the deal.

Where does the deal go?

tagToPipelineIdMapMaps order tags to a Pipedrive pipeline ID. First matching tag wins; a default catches the rest.
tagToStageIdMapMaps order tags to a stage ID within the pipeline. First matching tag wins; a default catches the rest.

These are tag maps, exactly as in the patterns module. Always set defaults, so every deal lands somewhere.

Which organisation and person?

customerFieldIdentifiersMaps customer identifier types to Pipedrive person or organisation field names, so the deal is linked to the right customer.
useNewestMatchingOrganisationDefault false. When several organisations match, the deal fails, because they're duplicates. When true, the newest (highest ID) is used and a warning lists every match for merging.
deliveryContactPersonFinds or creates the order's delivery contact as a Pipedrive person and links them to the deal. Orders only, because Unleashed's API doesn't expose a quote's delivery contact.

Duplicates stop deals

By default a customer that matches more than one Pipedrive organisation fails the deal. That's deliberate. Fix the duplicates in Pipedrive, or turn on useNewestMatchingOrganisation and work through the warnings.

How the delivery contact is matched

deliveryContactPerson has three parts: enabled (off by default), an optional contactIdField (a person custom field holding the source system's contact ID) and contactIdTag (the tag holding that ID, by default unleashed:delivery_contact_guid, which the Unleashed order import adds).

Rendering diagram...

A matched person gets the contact's name, and the contact's email and phone as their primary ones. Their other emails, phones and fields are left alone. If finding or creating the person fails, it's logged and the deal is created without one.

What goes on the deal?

includeProductsOnDealWhen true, the order's product lines are added to the deal. When false or unset, only the deal is created.
customFieldMappingMaps document fields (each identified by a CustomFieldType) to Pipedrive custom field API keys, so order data fills deal custom fields.
customFieldDateFormatThe date format for dates written to custom fields, in .NET format syntax, for example yyyy-MM-dd.
profitMarginDecimalPlacesThe decimal places used when writing profit margin to a custom field.
recordUrlFormat / recordUrlFieldA link to the record in the source system, written to the deal custom field named in recordUrlField. The number 0 in braces stands for the record's number.

For Unleashed, the link uses the record's number (not its ID) and starts with the account's region, for example:

https://au.unleashedsoftware.com/v2/SalesOrder/Update/{0}

and .../SalesQuote/Update/{0} on the quote settings.

Fern & Finch's sales visibility

Fern & Finch's account managers live in Pipedrive; orders are entered in Unleashed.

  • tagToPipelineIdMap defaults to the "Orders" pipeline; tagToStageIdMap defaults to "New".
  • customerFieldIdentifiers maps the Unleashed customer code to a Pipedrive organisation field that holds it.
  • deliveryContactPerson is enabled with contactIdField pointing at a person field called "Unleashed contact ID", so contacts are matched reliably on later orders.
  • includeProductsOnDeal is on; customFieldMapping writes the required date to a custom field with customFieldDateFormat dd/MM/yyyy.
  • recordUrlFormat uses the Unleashed URL for the account's region, so each deal links straight to its sales order.

Recap

  • Pipedrive receives orders and quotes as deals.
  • Tag maps choose the pipeline and stage; always set defaults.
  • Organisations are matched by customerFieldIdentifiers; duplicates fail the deal unless useNewestMatchingOrganisation is on.
  • deliveryContactPerson matches by contact ID, then email, then name, and links nobody when a step finds several.
  • Products, custom fields and a link back to the source record can all go on the deal.
Complete and continue

Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.