For supported operands, functions, operators, and expression syntax, see Dynamic formula reference.
- Amount formulas
- Percent formulas
- Quantity formulas
- Points formulas
Amount formula fields are shown when the selected configuration calculates a monetary value.Formula fields:
- Discount Amount formula: calculates the discount amount
- Fixed amount formula: calculates the fixed discount amount
- New price formula: calculates the new product price
Type a formula
Type or paste a formula directly into the formula field. Use the supported expression syntax. For example, to return a different value depending on the order amount, enter:Add formula elements
Select the formula field to show the formula toolbar. Use the toolbar to add formula elements. Available controls:- Add variable: Adds predefined operands, such as order, customer, or item values.
- Add metadata: Adds metadata operands.
- IF: Adds conditional logic.
- SWITCH: Adds switch logic.
- +: Adds an operator.
- Add FUNCTION: Adds a function.
- Templates: Opens predefined formula templates.
Use templates
Open Templates and click a template. Available templates:- Based on order amount: Creates formula logic based on the order amount.
- By customer metadata condition: Creates conditional formula logic based on customer metadata.
- By customer metadata value: Creates formula logic that uses a customer metadata value.
- By order currency: Creates formula logic based on the order currency.
Use the diagram view
Click Show diagram to open the formula in a diagram view. If the formula field is empty, the diagram view shows Click to add and template shortcuts. Use Click to add to start creating the formula visually, or select one of the displayed templates. If a formula is already defined, the diagram view shows the formula as connected nodes and keeps the editable expression below the diagram. In the diagram view, you can also use:- Formula toolbar and inline formula editor: Add or edit formula elements without leaving the diagram view.
- Zoom controls: Adjust the diagram view.
Format, validate, and save
Use Format to format the expression. Available options:- Format now: Formats the current formula
- Auto-format: Reformats the formula automatically while editing

