Availability: Enterprise*
*This feature is available as a part of the paid CPQ for HubSpot add-on. If this is something you're interested in, reach out to your Customer Success Manager or sign up for a demo.
Quote rules are customizable directives that allow you to manipulate content, settings, and variables within a quote. These rules enable you to automate complex workflows, ensuring that your quotes adhere to specific criteria and behaviors tailored to your business needs.
Skip to:
Quote data fields
Quote data fields are used to pass information into and out of a quote, allowing for dynamic adjustments throughout your workflow.
To create a new quote data field:
Select the Data icon next to the gear icon at the top right in your quote to open the Quote Data fields panel.
Select +Add fields.
Name your field.
Select the type (either text/string or number).
(Optional) Assign a default value to the field.
Save the quote.
After setting up the field, map data from previous workflow steps to it via the Data tab in the quote step.
Creating a rule
Watch a walkthrough video:
Note: You can create an unlimited number of rules per workflow.
Navigate to the Rules tab within your quote.
Select +Rule.
Rule structure
A rule consists of two main parts:
WHEN: Defines one or more conditions that trigger the rule. Conditions can be connected by:
‘And’ operator: All conditions must be true.
‘Or’ operator: At least one condition must be true.THEN: Specifies the actions to be performed when the conditions are met.
Tip: You can change the operator linking conditions by clicking on it in the WHEN section.
Available entities
When creating rules, you can reference and modify the following entities:
Line items - products within the quote, represented as an array of attributes.
Quote sections - groups of line items within a quote.
Quote variables - quote data field defined within the quote.
Quote totals - the summary fields of a quote, such as grand total.
Quote settings - general settings, like recipient option settings, or currency formatting.
Aliases - a subset of line items or sections based on the filtering criteria (for example, all sections that have "Product" in their name).
Note:
You can reference aliases only with positive operators.
Current items - revealed individual line items after filtering through aliases, allowing you to reference specific data (e.g., pricing, quantity).
Writing your rules
Start with basic rules and progressively move to more complex ones.
Alias
An alias is a reference name for a group of items captured in the WHEN condition. If you filter for line items that contain "Plan" in their name, it creates an alias for that group. In the THEN action, you could use this alias to apply a discount to all items in the "Plan" group.
WHEN condition
Filter line items or sections to create an alias. Note that string columns and number columns have different sets of comparison operators.
Important: Not all filtering operations return items, for example 'doesn't contain' will not create an alias.
Refer to any column value to define conditions.
Compare quote data fields against external data using a dropdown of available fields and comparison operators.
Note: To prevent the rules from executing multiple times and duplicating products in the quote block, ensure the condition 'Line items does not contain element with the specified SKU' is applied
THEN action
Set the value of the column for line items in your alias
Add items from the Product Catalog to a certain section
Set the value for a custom field in the Quote total section. To add a custom field, in Grand total select More > Custom field. Rename it as needed
Set the quote setting (recipient options and currency)
Set the value of the quote variable to propagate information into subsequent steps
Text boxes
You get access to a text box in two cases:
When you select an operator in the WHEN part.
When you set or update a value in the THEN part.
Here's what you can input:
Plain value: type "12" to set the price for the selected item as $12 or type "EUR" to set quote currency to euros.
Reference: start typing [ and select an alias, data fields, a grant total or sections value, or a current item you need from the dropdown. For example, select [Aliases.Line items 1.Price] to set a field value equal to the value of the Price column.
Calculation: start typing =( and select [Current item.Price], then type *12) in the text box. This will set a field value equal to twelve times the value of the Price column.
Formula: Type = and select a function and references you need from the dropdown
For example, choose SUM([Current item.Price] * 1.20) to apply a 20% increase for "Premium" products.
Managing rules
From the Rules tab, you can:
Delete a rule.
Enable/disable a rule.
Reorder rules.
Duplicate a rule.
You can duplicate or delete a rule by hovering over it and selecting three vertical ellipses on the far right > and selecting Delete or Duplicate from the dropdown.
New rules are enabled by default. To disable a rule while keeping it for future use, toggle off the status in the Rules list.
Note: If a rule is invalid, it will be automatically disabled upon saving.
To reorder rules, drag them by the handle on the left and drop them to the position you need.
Tips and tricks
Order matters. Add products first, then adjust their quantities.
Rule priority. Perform calculations first, then apply formatting.
Duplicate complex rules. Avoid rewriting by duplicating and tweaking existing rules.
Broad conditions. Use blanket conditions to capture all relevant line items, such as "Line items with a name not equal to [X]."
Testing your rules
Note: Rules recalculate on every quote change in the order listed on the Rules tab.
When you write a rule and save it, go back to the Build tab. From here:
Emulate the conditions from your rule, such as adding a specific value to the quote field.
After saving it, see if the rule has been triggered.
If the rules work in the way you intended, don't forget to revert changes to the quote - for example, delete the quote data fields value, if you expect your quote to receive it from the previous steps of the workflow.
Referring to specific fields
Quote data fields
Open a square bracket to select the field you'd like to refer to, like this:
This is used to access specific quote data fields from the quote context.
Referencing default columns for line items
You can reference the values of default columns like quantity, price, etc., for a group of line items. For example, to refer to the Quantity field in a group of line items:
Default column names you can refer to in quotes
id
sku
name
description
qty
price
cost
billing_frequency
contract_term
pricing_method
type
reference_type
Referencing custom columns
To refer to all values in a custom text column for line items, for example, a column named Low Margin, select [Alias.Line items 1.Low Margin]
Converting strings to numerical values and vice versa
When working with quote rules and variables, there are instances where you may need to convert data between different formats — specifically between strings (text) and numerical values. This is essential when performing calculations or applying formatting within your quote.
Converting strings to numerical values
To convert a string (text) value to a numerical value, you can use the VALUE function. This is particularly useful when your data is imported or added as text but needs to be used in mathematical operations.
Example:
Let's say you have a custom text column in your quote that stores the sample quantity of an item as a string (e.g., "10"). To use this in a calculation, you would need to convert it to a number.
=VALUE([alias.line-items-1.text_columns.Sample_QTY])
This converts the text "10" to the numerical value 10, which can then be used in further calculations.
Converting numerical values to strings
Conversely, there are situations where you may want to convert a numerical value to a string. This is useful when you need to format a number as text, such as displaying it with specific formatting in a quote.
Example:
If you want to display a calculated price with a currency symbol, you can use the TEXT function:
=TEXT([Alias.Line items 1.Price], "$#,##0.00")
This formula converts the numerical value of the price into a string formatted as currency, such as "$1,000.00".
Practical application in quotes
String to number conversion: Use this when you need to perform operations like summing up quantities or multiplying prices that were initially stored as text.
Number to string conversion: Use this when you need to display numbers with specific formatting, such as adding commas for thousands, appending currency symbols, or converting dates.
Example:
You can sum up quantities (QTY + Sample_QTY) and pull the calculated amount to a custom text Total QTY in the quote’s grand total.
To do this:
Add a custom text field to the grand total and rename it to “Total QTY”
Go to the Rules tab and create a new rule
Set the WHEN condition to filter for line items where "Sample_QTY" is not empty or contains valid data.
Set the THEN action to update Quote total’s custom field with the sum of the original "QTY" and the converted "Sample_QTY" value.
=SUM([Aliases.Line items 1.Quantity], VALUE[Aliases.Line items 1.Sample QTY])Select Run rules to see if it works correctly
Calculations
For calculations, the following mathematical operators are supported:
/ for division
* for multiplication
+ for addition
- for subtraction
Formulas
A formula is an expression you can write in the text box, and it must always begin with the = operator for the calculation to execute. For example:
=TEXT([Alias.Line items 1.Price]*12, "$#,##0.00")
Unless specified otherwise, formulas follow standard Excel syntax.
Math functions
Common mathematical functions include:
ROUND
ROUNDUP
ROUNDDOWN
SUM: Usage example: SUM(x, y)
Date and time functions
Default format
By default, date and time formulas use Excel's internal date format, which stores dates as integers. For example, the date 2008-08-08 is stored internally as 39668. To handle date values correctly, convert text dates into Excel's format using the DATEVALUE function.
Example:
=YEAR(DATEVALUE("2024-08-08"))
In this case, DATEVALUE converts the text date into Excel's internal date format, allowing the YEAR function to extract the year.
ISO Format
You can also convert dates into ISO format using the TEXT function. For example, to convert the current date into an ISO string, use this formula:
=TEXT(NOW(), "yyyy-mm-ddThh:MM:ss")
This converts the current date and time into the ISO 8601 standard format.
Supported functions
Supported functions
ACOS
ACOSH
ACOT
ACOTH
ADDRESS
AND
ARABIC
ARRAY
ARRAYROW
ASIN
ASINH
ATAN
ATAN2
ATANH
AVERAGE
AVERAGEA
AVERAGEIF
BIN2DEC
BIN2HEX
BIN2OCT
CEILING
CEILING.MATH
CEILING.PRECISE
COLUMN
CONCAT
CONCATENATE
CORREL
COS
COSH
COT
COTH
COUNT
COUNTA
COUNTBLANK
COUNTIF
CSC
CSCH
CUMIPMT
DATE
DATEDIF
DATEVALUE
DAY
DEC2BIN
DEC2HEX
DEC2OCT
DECIMAL
DEGREES
DUMMYFUNCTION
EDATE
EVEN
EXP
FACT
FACTDOUBLE
FALSE
FIND
FLOOR
FLOOR.MATH
FLOOR.PRECISE
FORECAST
FORECAST.LINEAR
FV
GCD
HEX2BIN
HEX2DEC
HEX2OCT
HLOOKUP
HOUR
IF
IFERROR
IFNA
IFS
INDEX
INT
IPMT
IRR
ISBLANK
ISERR
ISERROR
ISEVEN
ISLOGICAL
ISNA
ISNONTEXT
ISNUMBER
ISO.CEILING
ISODD
ISOWEEKNUM
ISTEXT
MAX
MAXA
MEDIAN
MID
MIN
MINA
MINUTE
MOD
MONTH
MROUND
NA
NOT
NOW
NPER
NPV
OCT2BIN
OCT2DEC
OCT2HEX
ODD
OR
PI
PMT
POWER
PPMT
PRODUCT
PV
RADIANS
RAND
RANDBETWEEN
RATE
REPLACE
RIGHT
ROMAN
ROUND
ROUNDDOWN
ROUNDUP
ROW
SEARCH
SEC
SECH
SECOND
SIGN
SIN
SINGLE
SINH
SLOPE
SMALL
SQRT
SQRTPI
STDEV
STDEV.P
STDEV.S
STDEVA
STDEVP
STDEVPA
SUM
SUMIF
SUMPRODUCT
SWITCH
TAN
TANH
TEXT
TIME
TIMEVALUE
TODAY
TRIM
TRUE
TRUNC
UPPER
VALUE
VAR
VAR.P
VAR.S
VARA
VARP
VARPA
VLOOKUP
WEEKDAY
WEEKNUM
XIRR
XNPV
XOR
YEAR
YEARFRAC