--- title: Scripts description: Learn how scripting extends CPQ beyond simple rules—understand where scripts run, what they return, and how to use them to model advanced configuration logic safely and efficiently. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/order-management/scripts.html release: australia topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 2 breadcrumb: [CPQ Configurator, Configure, price, quote apps, Explore, Sales Customer Relationship Management] --- # Scripts Learn how scripting extends CPQ beyond simple rules—understand where scripts run, what they return, and how to use them to model advanced configuration logic safely and efficiently. Scripting enhances CPQ when configuration logic requires more flexibility than simple rules. Administrators can use scripts to calculate complex values, evaluate conditions, or manipulate product data dynamically. Scripts are available in rule conditions, actions, and in blueprint enrichments for initialization, validation, or pricing. Scripting complements, but does not replace, declarative options. Use standard rules, picklist extensions, and product pickers first. Reserve scripting for specialized scenarios. ## Where can you use scripts - Rule conditions: Return `true` or `false` to determine whether actions run. - Rule actions: Set field values, hide or display elements, or build product lists dynamically. - Blueprint enrichments: Initialize data, call external systems, or enrich configurations during “On Configure” or “Reconfigure” events. Each script type requires a specific return value to ensure predictable results. ## Expected return values
| Script Type | Return Format | Example |
|---|---|---|
| Advanced condition | Boolean | `true` or `false` |
| Advanced hiding | String | `"field_to_hide"` |
| Field determination | Depends on field type | Number → `5`; Text → `"Red"`; Multi-select → ``` ["Option1", "Option2"] ``` |
| Inclusion and exclusion | Array | `["OptionA", "OptionB"]` |
| Product action | ProductList object | `ProductList.add({id:"123", qty:2})` |
| Enrichment | Updated configuration object | `return cfgRequest;` |