You are here:
Lookup Queries
Create lookup queries on your product rules and price rules to evaluate field values on objects other than quotes. You can then use your rule’s actions and conditions to send those values to a quote, quote line, or product option. (Salesforce CPQ Managed Package)
Required Editions
| Available in: Salesforce CPQ Winter ’16 and later |
Product rules and price rules contain the Lookup Object field, which defines the object containing fields that you want to evaluate. Rules also contain a related list for making lookup queries. Lookup queries reference the fields on the object that you can compare against your quote, quote line, or product option fields.
For example, your insurance company has a custom Premium Rate object with fields for age, crash history, and car type. When a sales rep makes an insurance quote for a prospective customer, they enter their customer’s age, crash history, and car type into matching custom quote fields. You set up lookup queries on either type of rule based on your needs.
- A product rule lookup query tests Premium Rate to see if your customer was in more than five accidents in their lifetime. If they were, the product rule adds a subscription product called High-Risk Insurance Premium to your quote.
- A price rule lookup query tests Premium Rate to see if your customer has never been in an accident. If so, the price rule applies a 5% discount to your insurance package.
The object that your lookup query evaluates can be a custom object, such as Premium Rate, or Salesforce CPQ’s Lookup Data object. If you don’t want to make a new object in your Salesforce org, use the lookup data object. All you have to do is create custom lookup data fields to store information such as age, crash history, and car type.
The lookup query object contains the following important fields.
- Tested Object
- Define the object that contains the field your lookup query evaluates.
- Lookup queries evaluate tested objects only on product options selected in product configuration or on quote lines that exist within the quote line editor.
- Tested Field
- Define the quote field that your lookup query evaluates.
Note Tested Field supports non-null values only. - Match Type
- Choose where this lookup query evaluates its target data. If you choose Static Value, Salesforce CPQ compares the value of the query’s Tested Value field against all the values in your dataset. It then selects the first dataset value that matches your tested value. If you choose Field Value, the query takes the value referenced in your quoting process and matches that value against the data in the table.
- Tested Value
- Define this value if your query uses a static match type.
- Lookup Field
- Define the lookup data field or custom object field that you want to test.
- Operator
- Define how Salesforce CPQ compares your lookup field to the field you’re testing.
- Using Lookup Queries with Product Rules
Use lookup queries with your product rules to query data from an object other than a quote. Use that data to change products and configurations in the quote line editor and configurator. (Salesforce CPQ Managed Package) - Using Price Rule Lookup Queries Against Custom Objects
Define a custom object to store data in Salesforce CPQ and then reference this data through lookup queries on your price rules. (Salesforce CPQ Managed Package) - Lookup Queries for Large Datasets
When you query a large dataset, you have several options for how you set up your rules and lookup queries. (Salesforce CPQ Managed Package)

