Overview
Computed values let you define formulas on offer categories that are evaluated dynamically for each customer during a Decision Flow. This enables personalization like custom pricing, dynamic discounts, and tailored messaging.How It Works
- Define computed fields on a category with a formula and output type
- Configure enrichment in a Decision Flow to load customer data from schema tables
- Add a compute stage to evaluate formulas per candidate offer
- Access results in the Recommend API response under the
personalizationfield
Formula Syntax
The formula engine supports:| Feature | Example |
|---|---|
| Arithmetic | base_rate * 1.05 |
| Comparison | amount > 1000 |
| Ternary | tier == "gold" ? 0.15 : 0.10 |
| Functions | min(rate, 0.25), max(amount, 100) |
| Rounding | round(price, 2) |
| Null handling | coalesce(custom_rate, default_rate) |
| String concat | concat(first_name, " ", last_name) |
Variable Namespaces
| Prefix | Source | Example |
|---|---|---|
| (none) | Other custom fields on the offer | base_rate |
customer.* | Enriched data from schema tables | customer.loan_amount |
attributes.* | Request-time attributes from Recommend API | attributes.tier |
Example
A “Personal Loan” category with a computed field:personalized_rate using the customer’s enriched loyalty_score and the offer’s base_rate.
Next Steps
Formula Reference
Complete list of operators, functions, and variable namespaces.
Decision Flows
See how computed values are evaluated in the Compute stage.
API Tutorial
Learn how computed values appear in the Recommend API response.