---
sourceDocument: Australia Sales and Order Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/order-management

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia Sales and Order Management

ft:clusterId :

    - omgmt

bundleId :

    - omgmt

workflow :

    - Customer and Industry


---

# Create scripts

# Create scripts {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

Learn how to create advanced functions using the scripting interface.

Some use cases require an advanced condition or action. Other times, the administrator may prefer script versus leveraging simple rules. For these occasions, CPQ offers the ability to write scripts in key areas.

Scripting is available in rule actions and conditions, behind the Advanced menu choice or toggle.


When you click Create Advanced Function, the script editor opens, including the tools you need to write a script.

When the script editor first opens, it provides the expected return format of the script.

* Advanced conditions return true or false.
* Advanced hiding rules return a text string.
* Advanced determination rules return the type of the field that they are setting.
  * A determination rule that sets a number returns a number.
  * A determination rule that sets a multi-select picklist returns an array.
  {#scripting__ul_pw2_34g_bhc}
* Advanced inclusion and exclusion rules return an array.
* Product rules return ProductList.

{#scripting__ul_tbn_14g_bhc}

For more details and a script sample, review the "Advanced product actions" section of [Rules](https://servicenow-prod.fluidtopics.net/0jeoZYZ~Zc8QyLRoCARYOw "Learn how to create and manage rules to deliver dynamic configuration experiences. Define conditions and actions to show or hide fields, display messages, calculate values, and generate bills of material (BOMs). Explore rule types, including visibility, message, inclusion, exclusion, determination, and product actions, to efficiently build intelligent, responsive configurations.").

The ? Help button opens a menu of available functions. Each entry includes a description of the function, the parameters it accepts, its output, and an example that can be inserted at the current location of
the cursor in the script.


As you type in the script editor, suggestions are provided, including functions, configurable field variable names, and local variables. Using this feature helps eliminate mismatched variable names and typing errors. In the
screenshot below, typing <kbd class="ph userinput">Ma</kbd> gives the user two available functions (Map and Math) and a list of all matching fields. Additional inputs narrow the list of matching options.


At the bottom of the scripting interface, the debugger lets you test your script by defining values for the variables (fields) that it references. Debugger input is provided in JSON format. For your convenience, review
field-specific formats in the fields information help (arrow).


It can be helpful to save your debugger inputs as comments in your script for easy pasting into the debugger when you need to test the script.

Calls to `console.log()` in the script are returned in the debugger output.  
Also see the following sample scripts:

* [Sample Message Script - Array and Map Function](https://docs.google.com/document/d/1SqDGH6Y6UKV-0kGhzuqfGyII1dI2CezzQifEzulNlfY/edit)
* [Sample Number Field Determination](https://docs.google.com/document/d/1HvC6jybMhpgEgvsPnvlt7kwmiXKTYtVjJqmL3iANiHU/edit)
* [Sample Product Rule Scripts](https://docs.google.com/document/d/1bSJ_kMcJmHnlH6C67U6tatpxha-EBzyp1IJX5XQ3FYA/edit)
* [Sample Product Rule Script With For Loop](https://docs.google.com/document/d/1ICHHJVT3ITlbozUIqpMZTEkUEZgEBbwMoiNWAK6JsO8/edit)
* [Sample Text Field Determination](https://docs.google.com/document/d/1Vgkixyoh4m51UYh1nC60gOyfNZ9-VSZKlU8ojJQuhF0/edit)
{#scripting__ul_yjs_xq5_ghc}
**Zugehörige Konzepte**   

* [Using comments and the console to debug scripts](https://servicenow-prod.fluidtopics.net/FZny1PXRXf2Z8BOEAPDDhg "Learn how comments and the console can help you debug your scripts.")
* [Scripting: Checking for first and subsequent configurations](https://servicenow-prod.fluidtopics.net/bqFAdC4MeH52Qe~678BnmQ "You can test whether a configuration is being initialized or being reconfigured, and set code to execute based on the result.")
* [Scripting: How to populate set values](https://servicenow-prod.fluidtopics.net/w9K0XeOpjW_6ft26VqPDTQ "View a detailed example of how to use an On Configure/Reconfigure blueprint enrichment script to load field values into a set.")  
**Zugehörige Verweise**   

* [CPQ scripting language reference](https://servicenow-prod.fluidtopics.net/fu7Apfv23glYEM3NkmSsEQ "View the operators, objects, and keywords that CPQ supports, together with information about type conversion, type checking, alternative scripts for unsupported operations, and accessing object properties.")
* [Sample scripts](https://servicenow-prod.fluidtopics.net/g_PWwQ0nmyKRimIGOzCIIg "View a selection of commonly requested sample scripts.")

