Understanding the best match algorithm for Product Configurator

What you will learn
In this document, we'll break down how the Best Match process works in Zoho CRM's Product Configurator (CPQ) and explore how CPQ shortlists and applies the best-matched rules based on the items quoted, product-specific criteria, and common criteria.
Please note that the scenarios or explanations provided here are simplified for the sake of clarifying the concepts involved. While they might not fully represent real-world business functions, they're designed to help you grasp the key mechanisms behind the Best Match process.
Overview
Zoho CRM's Configure, Price, Quote (CPQ) system is designed to streamline the configuration, pricing, and quoting process for businesses that offer complex products or services. CPQ ensures that all configurations adhere to the rules set by the organization, enabling accurate pricing and reducing errors in quotes.

To explore how CPQ works, including how to set up product configurations, pricing models, and rule-based logic, refer to the
Zoho CRM CPQ documentation.
The Product Configurator is where you define the actions that need to be automated upon the selection of specific products. Key actions supported in the Product Configurator include:
- Mandatory actions: Automatically applied rules that are non-negotiable.
- Suggested actions: Recommendations made based on the products and configurations added to the quote.
- Quoted item field updates: Automatic updates to fields in the quoted items based on configured rules.
When a sales rep adds products to a quote, the CPQ engine compares the products and criteria in the quote against the predefined rules created by the admin in Product Configurator and determines the best rule to apply.
The system uses what we call the Best Match process to suggest the most relevant product configurations.
In this document, we'll explore how CPQ evaluates these factors to provide the best possible actions based on different scenarios.

Note:
- In this document, we focus only on suggested actions to demonstrate how the CPQ system presents options to the user. While mandatory actions are applied automatically, suggested actions require the user's confirmation in order to be applied.
Steps followed in the Best Match process
The Best Match process involves several key steps followed in a specific order:
- Step 1: Shortlisting rules
The system first identifies rules that contain the most products from the quote. For example, if the quote includes an smartphone and earphones, the system will prioritize rules that involve both products over rules that may include either a smartphone or earphones. - Step 2: Evaluating product criteria
Once the relevant rules are shortlisted, the system checks the product-specific criteria (such as the quantity or list price). Rules with matching product criteria are prioritized. - Step 3: Checking common criteria
If more than one rule has matching product criteria, the system then evaluates any common criteria, such as the billing city. - Step 4: Rule order
If two or more rules match at all levels, the system will apply the rule that appears higher in the rule list order.
Applying the best match: rule examples and scenarios
Let's consider a quote generated for a customer who wants to purchase one Zylker Mobile and two Zylker Earphones. Additionally, the quote is for a customer from New York City, and the billing will be processed there. Let's take a look at different scenarios where the system selects the best matching product configurator rule for this particular quote.
Scenario 1: Based on product count in a rule
- Rule 1: If the quoted items include a Zylker Mobile, suggest Zylker Power Adapter.

- Rule 2: If the quoted items include both a Zylker Mobile and Zylker Earphones, suggest a Zylker Wireless Charger.

In this scenario, the system matches the rules with the quote and looks for the rule with the most matching products.
☑ Rule 2 is selected as the best match.
Best match condition: Rule 2 matches both the products in the quote.
Scenario 2: Based on product-specific criteria in a rule
- Rule 1: If the quoted items include a Zylker Mobile and a pair of Zylker Earphones, suggest a Zylker Power Adapter.

- Rule 2: If the quoted items include both a Zylker Mobile and Zylker Earphones, suggest a Zylker Wireless Charger. Additionally, there's a product criterion that checks for a quantity of Zylker Earphones greater than or equal to two.

In this scenario, the system matches the rules with the quote and finds that both rules include all the products in the quote. Accordingly, the system checks for the product criteria.
☑ Rule 2 is selected as the best match.
Best match condition: Rule 2 matches the product criteria.
Scenario 3: Based on common criteria in rules
- Rule 1: If the quoted items include both a Zylker Mobile and two or more Zylker Earphones, suggest a Zylker Wireless Charger.

- Rule 2: This is the same as Rule 1, but with an additional common criterion that applies the rule when the quote is generated with New York City entered as the billing city.

In this scenario, the system identifies that both rules consist of all the products from the quote and match the product-specific criterion of two or more pairs of earphones.
☑ Rule 2 is selected as the best match.
Best match condition: Rule 2 matches the common criteria since the billing city is New York City.

Scenario 4: Based on rule order in a rule
- Rule 1: If the quoted items include both a Zylker Mobile and two or more Zylker Earphones, and that the billing city is New York City, suggest a Zylker Wireless Charger.

- Rule 2: Same as Rule 1.
Since both rules are identical in terms of products, product-specific criteria, and common criteria, the algorithm checks for the order of the rules.
☑ Rule 1 is selected as the best match.
Best match condition: Rule 1 is higher in the order of the rules list page and therefore takes priority over Rule 2.

- You can re-order rules based on your requirements from the Product Configurator's rules page. You have to filter the rules based on the module, layout, and subform to unlock the Re-order rules button.

Scenario 5: Applying multiple rules
- Rule 1: If the quoted item includes a Zylker Mobile, suggest a Zylker Wireless Charger.

- Rule 2: If the quoted item includes Zylker Earphones and has a product-specific criterion requirement of two or more earphones, suggest Zylker Wireless Charger.
Because each of the rules contains one of the products from the quoted items, both rules are applicable.
☑ Rule 1 is selected because it contains a Zylker Mobile.
☑ Rule 2 is selected because it contains Zylker Earphones.
Based on the rule setup, the system suggests both rules, which the user can then select from.

Phases of rule execution
Here's how Product Configuration (PC) rules are applied during each stage of the process:
- While saving a record, a review pop-up will display line items that have been added or updated based on the execution of PC rules.
For example, if Rule 2 specifies the Zylker Power Adapter as a mandatory product and it's selected as the best matching rule, the review pop-up will show the power adapter added to the line items, and the info button will display the rule details. You can select to save the record with these latest changes.

- Once you save a record, applicable PC rules are applied based on any updated products or changes made by other automation settings within Zoho CRM, such as workflow field updates.
- Later, after the record is saved, if any fields or subform line items are edited or updated in any way, the relevant PC rules are re-applied based on the new values.
CRM and CPQ co-relation
Zoho CRM rules are executed first, followed by CPQ rules. For example, if a workflow rule changes a field value( such as assigning an owner based on the city), the CPQ rule can then use that updated owner value to determine the appropriate action.