---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Evaluate expressions in runtime using Console

# Evaluate expressions in runtime using Console {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Define, declare, and verify new variables and functions while you debug a script in runtime using Console. The script execution must be paused to use Console.

## Before you begin

* Review [Limitations with using Console](https://servicenow-prod.fluidtopics.net/ywHYxLvKuHS62h3gIDzrpw "You need to be aware of a few limitations when you use Console to evaluate expressions while debugging a script in runtime.")
* Role required: script_debugger, admin
{#evaluate-expressions__ul_mlt_slr_2mb}

## Procedure

1. Launch the Script Debugger in one of the following ways.

   | Application | Navigation path |
   | Application navigator | Navigate to System Diagnostics \> Script Debugger. |
   | Studio | Navigate to File \> Launch Script Debugger. |
   | Syntax Editor | Click the Script Debugger icon ![script debugger icon](). |
   |-|-|

   {#evaluate-expressions__choicetable_qyb_t5z_ylb}  
   The Script Debugger modal is displayed.
2. Trigger the script.  
   For example, create a record to trigger an insert business rule script. The Script Debugger pauses the script on the first line that contains a breakpoint, and then you see the ServiceNow Script Debugger confirmation window.
3. Click Start Debugging.  
   The focus shifts to the Script Debugger window and you see the target script that paused at the first breakpoint.  
   Note:  
   Make sure that the status of Script Debugger is EXECUTION_PAUSED. You can use Console only when the script execution is paused during debugging.
4. Click the expand console (![Expand Console icon.]()) to expand the Console pane.  
   To start evaluating expressions, enter one or more expressions in the Console and press Enter. For example, enter <kbd class="ph userinput">var x = 10;</kbd> and press Enter. To enter multiple lines of expressions, press Shift + Enter after each line and press Enter after the last expression. To clear all the expressions in the Console, click the clear console icon (![Clear console icon]()). For more information on Console controls, see [Script Debugger step-through and console controls](https://servicenow-prod.fluidtopics.net/tYslWQCcqBEoxtsIt5d~Dw "After the Script Debugger pauses a script, use the step-through controls to move between script lines and move between scripts in the call stack. Use the Console controls to expand console, collapse console, clear console, and rerun expressions.").

   After a statement is executed, it is stored in the browser cache. You can use the up arrow key to get the previous statement and the down arrow key to get the next statement from the browser cache. You can configure
   the number of cached statements for a session from user preferences. For more information about user preferences settings, see [Script Debugger and Session Log](https://servicenow-prod.fluidtopics.net/eFpTaSOE7boTyKwIcHQ5wQ "The Script Debugger enables users with the script_debugger role to debug server-side JavaScript. Users with the log_debugger role can use the Session Log to view and download required logs.").

## Result

After a statement is executed, it is stored in the browser cache. You can use the up arrow key to get the previous statement and down arrow key to get the next statement from the browser cache. You can configure the number of
cached statements for a session from user preferences. For more information about user preferences settings, see [Script Debugger and Session Log](https://servicenow-prod.fluidtopics.net/eFpTaSOE7boTyKwIcHQ5wQ "The Script Debugger enables users with the script_debugger role to debug server-side JavaScript. Users with the log_debugger role can use the Session Log to view and download required logs.").
* **[Limitations with using Console](https://servicenow-prod.fluidtopics.net/ywHYxLvKuHS62h3gIDzrpw)**   
  You need to be aware of a few limitations when you use Console to evaluate expressions while debugging a script in runtime.

**Related reference**   

* [Limitations with using Console](https://servicenow-prod.fluidtopics.net/ywHYxLvKuHS62h3gIDzrpw "You need to be aware of a few limitations when you use Console to evaluate expressions while debugging a script in runtime.")

