Which identifier wins
Lesson 7 of 24 7 min read
When more than one identifier could apply, Supply Lens follows a strict order to pick one. Learn the order for Products, so you can predict which code is matched and which code is sent.
Most of the time only one identifier fits and there is nothing to decide. But once you start scoping codes to partners and Integrations, a Product can have several identifiers of the same type that all apply. This lesson explains how Supply Lens chooses, so the result never surprises you.
Two steps: filter, then rank
Whether Supply Lens is matching a code that has come in or choosing a code to send out, it follows the same two steps.
1. Filter. Any identifier scoped to a different Party, country, currency or Integration from the Document is thrown away. Identifiers with no scope, and identifiers scoped to exactly this context, survive.
2. Rank. The survivors are compared one question at a time. For Products the questions are, in order:
- Is it scoped to the Party (the customer on the Document)?
- Is it scoped to the country?
- Is it scoped to the currency?
- Is it scoped to the Integration?
At each question, an identifier that is scoped beats one that isn't. The first question that separates two identifiers decides, and the later questions are never asked.
The order is strict, not a points system
Because the first difference decides, an identifier scoped only to the customer beats one scoped to country, currency and Integration together. Think of it as a dictionary sort, not a score.
A worked example
Hilltop sends shipment confirmations to Shopify, and to some wholesalers. House Blend 250g has three identifiers of the same type:
| Row | Value | Party | Currency | Integration |
|---|---|---|---|---|
| 1 | HT-HOUSE-250 | (none) | (none) | (none) |
| 2 | HT-HOUSE-250-GBP-SHOP | (none) | GBP | Shopify |
| 3 | GL-HOUSE | Greenleaf | (none) | (none) |
Which code is sent?
- A shipment for Greenleaf, in GBP, going to Shopify. All three rows survive the filter. Row 3 wins at the first question: it is the only one scoped to the customer, even though row 2 is scoped on two things.
- The same shipment for a different customer. Row 3 is filtered out (it is scoped to Greenleaf). Rows 1 and 2 tie on Party and country, and row 2 wins on currency.
- A shipment in EUR for a different customer. Rows 2 and 3 are both filtered out, so row 1, the unscoped default, is used.
When identifiers tie
If two identifiers survive every question level with each other:
- They belong to the same Product. These are just duplicate rows. Supply Lens uses one of them and carries on without an error. If the values differ, though, which one is sent is effectively arbitrary, so give one a narrower scope.
- They belong to different Products, on an incoming Document. The match is ambiguous. Supply Lens reports an error naming both Products instead of picking one, because the data is wrong and needs fixing.
The identifier type is not part of the ranking. A barcode scoped to the customer beats an unscoped SKU; an unscoped SKU and an unscoped barcode on the same line that point to different Products are a tie, and reported as ambiguous.
Rules of thumb
- Leave universal codes (your SKU, printed barcodes) unscoped.
- Scope partner-specific codes to that Party.
- Use an Integration scope when one system needs a different code for the same Product.
- Never put the same code, at the same scope, on two Products.
Recap
- Supply Lens first throws away identifiers scoped to a different context, then ranks the rest.
- For Products the ranking order is Party, then country, then currency, then Integration.
- The first difference decides: a customer-scoped code beats one scoped on everything else combined.
- Duplicate rows on one Product don't error, but differing values make the code sent unpredictable.
- The same code on two Products at the same scope makes an incoming match ambiguous, and the Document errors.
Quick guides for this topic
Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.