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 is calculated using the customer’s enriched loyalty_score and the offer’s base_rate.