Product documentation Docs
    • English
    • Deutsch
    • 日本語
    • 한국어
    • Français
  • More Sites
    • Now Community
    • Developer Site
    • Knowledge Base
    • Product Information
    • ServiceNow.com
    • Training
    • Customer Success Center
    • ServiceNow Support Videos
  • Log in

Product documentation

  • Home
How search works:
  • Punctuation and capital letters are ignored
  • Special characters like underscores (_) are removed
  • Known synonyms are applied
  • The most relevant topics (based on weighting and matching to search terms) are listed first in search results
Topics are ranked in search results by how closely they match your search terms
  • A match on the entire phrase you typed
  • A match on part of the phrase you typed
  • A match on ALL of the terms in the phrase you typed
  • A match on ANY of the terms in the phrase you typed

Note: Matches in titles are always highly ranked.

  • Release version
    Table of Contents
    • Now Platform App Engine
Table of Contents
Choose your release version
    Home Paris Now Platform App Engine Now Platform App Engine APIs and scripts Scripts JavaScript syntax editor

    JavaScript syntax editor

    • Save as PDF Selected topic Topic & subtopics All topics in contents
    • Unsubscribe Log in to subscribe to topics and get notified when content changes.
    • Share this page

    JavaScript syntax editor

    The syntax editor provides support for editing JavaScript scripts.

    The syntax editor has these features.

    • JavaScript syntax coloring, indentation, line numbers, and automatic creation of closing braces and quotes
    • JavaScript support
    • Linting using the ESLint utility
      Note: Modify or view default linting configurations by accessing the glide.ui.syntax_editor.linter.eslint_config property in the System Property [sys_properties] table. See Available system properties for more information.
    • Context menu for script includes, API, and tables
    • Script macros for common code shortcuts

    This feature requires the Syntax Editor (com.glide.syntax_editor) plugin.

    Figure 1. JavaScript editor
    JavaScript editor

    Script macro maintenance

    Administrators can define new script macros or modify existing script macros.

    Before you begin

    Role required: admin

    About this task

    Script macros provide shortcuts for typing commonly used code. Several script macros are available by default. Administrators can define new or modify existing script macros.

    Procedure

    1. Navigate to System Definition > Syntax Editor Macros.
    2. Click New or select the macro to edit.
    3. Define the macro details with the fields listed in the table below.
      Table 1. Editor macro fields
      Field Description
      Name Macro keyword text users type to insert macro text.
      Comments Description of the macro. This text appears when the user types help.
      Text Full macro text that replaces the name in the editor.

    Syntax editor plugin

    Enable the syntax editor plugin to use the syntax editor.

    The syntax editor enables the following features for all script fields:

    • JavaScript syntax coloring, indentation, line numbers, and automatic creation of closing braces and quotes
    • Code editing functions
    • Code syntax checking
    • Script macros for common code shortcuts
    Figure 2. JavaScript syntax editor

    The syntax editor can be disabled or enabled by modifying the glide.ui.javascript_editor property in the sys_properties.list. In addition, administrators can configure the syntax editor to show error and warning indicators next to a line of code that contains an error by modifying the glide.ui.syntax_editor.show_warnings_errors property. For information on the sys_properties.list, refer to Available system properties.

    Note: Administrators can disable or enable the syntax editor for all users, regardless of user preference.

    Searching for errors by line

    To locate the exact position of the error in a large script, click the Go to line icon.

    This feature is particularly useful when you are encounter a syntax error in a log file rather than in the ServiceNow record itself. In this case, you can navigate to the record and search for errors by line number. In the dialog box that appears, enter the line number of an error, and then click OK. Your view moves to the site of the error, and the cursor marks the correct line and column.

    Note: For this feature to function, you must disable the Syntax Editor.
    Figure 3. Go to script error

    Navigate to a line number

    When the syntax editor is disabled, users can navigate to a specific line in the code using the Go to line icon (The go to line icon).

    1. Click the Go to line icon (The go to line icon).
      Note: This icon is not available when the editor is enabled.
    2. Enter a number in the field and then press Enter.

    Syntax editor JavaScript support

    The syntax editor provides editing functions to support editing JavaScript scripts.

    JavaScript editing functions

    Icon Keyboard Shortcut Name Description
    N/A Toggle Syntax Editor Disables the syntax editor. Click the button again to enable the syntax editor.
    Access Key + R Format Code Applies the proper indentation to the script.
    Access Key + C Comment Selected Code Comments out the selected code.
    Access Key + U Uncomment Selected Code Removes comment codes from the selected code.
    N/A Check Syntax Checks the code for syntax errors. By default, the system automatically checks for syntax errors as you type in a script field. If an error or warning is found, the syntax editor displays a bullet beside the script line containing the error or warning. This check occurs on all script fields.
    Access Key + \ Start Searching Highlights all occurrences of a search term in the script field and locates the first occurrence. Click the icon, then enter the search term and press Enter. You can use regular expressions enclosed in slashes to define the search term. For example, the term /a{3}/ locates aaa.
    Access Key + [ Find Next Locates the next occurrence of the current search term in the script field. Use Start Searching to change the current search term.
    Access Key + ] Find Previous Locates the previous occurrence of the current search term in the script field. Use Start Searching to change the current search term.
    Access Key + W Replace Replaces the next occurrence of a text string in the script field.
    1. Click the icon, then enter the string to replace and press Enter. You can use regular expressions enclosed in slashes to define the string to replace. For example, the term /a{3}/ locates aaa.
    2. Enter the replacement string and press Enter.
    Access Key + ; Replace All Replaces all occurrences of a text string in the script field.
    1. Click the icon, then enter the string to replace and press Enter. You can use regular expressions enclosed in slashes to define the string to replace. For example, the term /a{3}/ locates aaa.
    2. Enter the replacement string and press Enter.
    N/A Save Saves changes without leaving the current view. Use this button in full screen mode to save without returning to standard form view.
    Access Key + L Toggle Full Screen Mode Expands the script field to use the full form view for easier editing. Click the button again to return to standard form view. This feature is not available for Internet Explorer.
    Access Key + P Help Displays the keyboard shortcuts help screen.

    JavaScript editing tips

    • To fold a code block, click the minus sign beside the first line of the block. The minus sign only appears beside blocks that can be folded. To unfold the code block, click the plus sign.
    • To insert a fixed space anywhere in your code, press Tab.
    • To indent a single line of code, click in the leading white space of the line and then press Tab.
    • To indent one or more lines of code, select the code and then press Tab. To decrease the indentation, press Shift + Tab.
    • To remove one tab from the start of a line of code, click in the line and press Shift + Tab.

    JavaScript resources

    Scripts use ECMA 262 standard JavaScript. Helpful resources include:

    • Mozilla: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference
    • ECMA Standard in PDF format: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
    • History and overview: http://javascript.crockford.com/survey.html
    • JavaScript number reference: http://www.hunlock.com/blogs/The_Complete_Javascript_Number_Reference

    Context menu

    Enable the context menu for script includes, Glide APIs, and tables in the JavaScript editor.

    With the context menu options, your users can navigate to:
    • Script include definitions
    • Glide API documentation
    • System and custom table definitions and data

    In the syntax editor, bold font is used for tokens that have a context menu. Right-click the token to view context menu options. If you use a Mac, you can use the Command-click shortcut.

    Table 2. Context menu options
    Token type Context menu option Description
    Script include Open Definition Definition of the script include in a new window.
    Find References List of files referencing the script include.
    Note:
    • To view the preview of the file, click the preview script icon Preview script icon.
      • To open the file in a new window, click Open File.
    • To view all files that reference the script include, click Show All Files.
    Glide API Show Documentation Documentation page of the Glide API.
    Table Show Definition Definition of the system or custom table in a new window.
    Show Data Records in the table that are based on the role of the current user.
    Enable or disable the context menu in the script editor using the glide.ui.syntax_editor.context_menu property in the System Property [sys_properties] table. See Available system properties for more information.
    Note: Context menu options can be accessed only if the browser supports SharedWorker. For example, Google Chrome and Mozilla Firefox.

    Syntax editor macros

    Script macros provide shortcuts for typing commonly used code. To insert macro text into a script field, enter the macro keyword followed by the Tab.

    vargr
    • Description: Inserts a standard GlideRecord query for a single value.
    • Output:
      var now_GR = new GlideRecord("");
      now_GR.addQuery("name", "value");
      now_GR.query();
      if (now_GR.next()) {
                      
      }
                    
    vargror
    • Description: Inserts a GlideRecord query for two values with an OR condition.
    • Output:
      var now_GR = new GlideRecord('');
                      
      var qc = now_GR.addQuery('field', 'value1');
                      
      qc.addOrCondition('field', 'value2');
      now_GR.query();
                      
      while (now_GR.next()) {
                      
                      
      }
                    
    for
    • Description: Inserts a standard recursive loop with an array.
    • Output:
      for (var i=0; i< myArray.length; i++) {
       //myArray[i];
       
      }
    info
    • Description: Inserts a GlideSystem information message.
    • Output:
      gs.addInfoMessage("");
    method
    • Description: Inserts a blank JavaScript function template.
    • Output:
      /*_________________________________________________________________
         * Description:
         * Parameters:
         * Returns:
         ________________________________________________________________*/
         : function() {
         
         },
      
    doc
    • Description: Inserts a comment block for describing a function or parameters.
    • Output:
      /**
                      
       * Description: 
                      
       * Parameters: 
                      
       * Returns:
      */

    Script syntax error checking

    All script fields provide controls for checking the syntax for errors and for locating the error easily when one occurs. The script editor places the cursor at the site of a syntax error and lets you search for errors in scripts by line number.

    Figure 4. Script syntax check

    The script editor notifies you of syntax errors in your scripts in the following situations.

    • Save a new record or update an existing record. A banner appears at the bottom of the editor showing the location of the first error (line number and column number), and the cursor appears at the site of the error. Warnings presented at Save or Update show only one error at a time.
      Figure 5. Script syntax error (short)
    • Click the syntax checking icon before saving or updating a record. A banner appears at the bottom of the editor showing the location of all errors in the script, and the cursor appears at the site of the first error.
      Figure 6. Script syntax error

    Syntax editor keyboard shortcuts and actions

    The syntax editor offers keyboard shortcuts and actions to assist in writing code.

    Table 3. Syntax editor keyboard shortcuts and actions for writing code
    Keyboard shortcut or action Description Example
    Write code

    Scripting assistance

    Control+Spacebar

    Displays a list of valid elements at the insertion point such as:
    • Class names
    • Function names
    • Object names
    • Variable names

    Double-click an entry to add it to the script.

    A line of code for a variable definition with a pop-up window displaying potential scripting elements.
    Enter a period character after a valid class name.

    Displays a list methods for the class.

    Double-click an entry to add it to the script.

    A line of code for a variable definition with a pop-up window displaying potential scripting elements.
    Enter an open parenthesis character after a valid class, function, or method name.

    Displays the expected parameters for the class or method.

    Enter the expected parameters as needed.

    A line of code for a variable defining a method call. There is a pop-up window displaying potential scripting elements.

    Toggle full screen mode

    Control+M

    Switches between displaying the form with the full screen and displaying it normally.
    Format code
    • Windows: Control+Shift+B
    • Mac: Command+Shift+B
    Formats the selected lines to improve readability.
    Several lines of unformatted code
    Several lines of code formatted for readability
    Toggle comment
    • Windows: Control+/
    • Mac: Command+/
    Adds or removes the comment characters // from the selected lines.
    A line of code selected with no comment characters
    A line of code selected with comment characters added to the front of the line.
    Insert macro text
    1. In the Script field, type the macro keyword text. For example help.
    2. Press Tab.
    Inserts macro text at the current position.
    A line of code containing the string help.
    The macro text for help added to the script.
    Search
    Start search
    • Windows: Control+F
    • Mac: Command+F

    Highlights all occurrences of a search term in the script field and locates the first occurrence.

    You can create regular expressions by enclosing the search terms between slash characters . For example, the search term /a{3}/ locates the string aaa .

    A search field with the term gr.
    The search results of the search term gr displaying four highlighted items. The first search result is selected.
    Find next
    • Windows: Control+G
    • Mac: Command+G
    Locates the next occurrence of the current search term in the script field. Use Start Searching to change the current search term.
    The search results of the search term gr displaying four highlighted items. The second search result is selected.
    Find previous
    • Windows: Control+Shift+G
    • Mac: Command+Shift+G
    Locates the previous occurrence of the current search term in the script field. Use Start Searching to change the current search term.
    The search results of the search term gr displaying four highlighted items. The first search result is selected.
    Replace
    • Windows: Control+E
    • Mac: Command+E
    Replaces the next occurrence of a text string in the script field.
    A replace field with the string gr.
    A replace with field with the string gl.
    A replace confirmation dialog with options for Yes, No, and Stop
    Replace all
    • Windows: Control+;
    • Mac: Command+;
    Replaces all occurrences of a text string in the script field.
    A replace field with the search term gr.
    A replace with field with the string gl.
    Help
    Help
    • Windows: Control+H
    • Mac: Command+H
    Displays the list of syntax editor keyboard shortcuts.
    A pop-up window displaying the keyboard shortcuts for the Syntax Editor.
    Show description
    • Windows: Control+J
    • Mac: Command+J
    Displays API documentation for the scripting element at the cursor's current location.
    A line of code selected with a pop-up window displaying API help for the GlideRecord object
    Show macros
    1. In the Script field, type help.
    2. Press Tab.
    Displays the list of available syntax editor macros as text within the script field.
    A line of code containing the string help.
    The macro text for help added to the script.

    Tags:

    Feedback
    On this page

    Previous topic

    Next topic

    • Contact Us
    • Careers
    • Terms of Use
    • Privacy Statement
    • Sitemap
    • © ServiceNow. All rights reserved.

    Release version
    Choose your release version

      JavaScript syntax editor

      • Save as PDF Selected topic Topic & subtopics All topics in contents
      • Unsubscribe Log in to subscribe to topics and get notified when content changes.
      • Share this page

      JavaScript syntax editor

      The syntax editor provides support for editing JavaScript scripts.

      The syntax editor has these features.

      • JavaScript syntax coloring, indentation, line numbers, and automatic creation of closing braces and quotes
      • JavaScript support
      • Linting using the ESLint utility
        Note: Modify or view default linting configurations by accessing the glide.ui.syntax_editor.linter.eslint_config property in the System Property [sys_properties] table. See Available system properties for more information.
      • Context menu for script includes, API, and tables
      • Script macros for common code shortcuts

      This feature requires the Syntax Editor (com.glide.syntax_editor) plugin.

      Figure 1. JavaScript editor
      JavaScript editor

      Script macro maintenance

      Administrators can define new script macros or modify existing script macros.

      Before you begin

      Role required: admin

      About this task

      Script macros provide shortcuts for typing commonly used code. Several script macros are available by default. Administrators can define new or modify existing script macros.

      Procedure

      1. Navigate to System Definition > Syntax Editor Macros.
      2. Click New or select the macro to edit.
      3. Define the macro details with the fields listed in the table below.
        Table 1. Editor macro fields
        Field Description
        Name Macro keyword text users type to insert macro text.
        Comments Description of the macro. This text appears when the user types help.
        Text Full macro text that replaces the name in the editor.

      Syntax editor plugin

      Enable the syntax editor plugin to use the syntax editor.

      The syntax editor enables the following features for all script fields:

      • JavaScript syntax coloring, indentation, line numbers, and automatic creation of closing braces and quotes
      • Code editing functions
      • Code syntax checking
      • Script macros for common code shortcuts
      Figure 2. JavaScript syntax editor

      The syntax editor can be disabled or enabled by modifying the glide.ui.javascript_editor property in the sys_properties.list. In addition, administrators can configure the syntax editor to show error and warning indicators next to a line of code that contains an error by modifying the glide.ui.syntax_editor.show_warnings_errors property. For information on the sys_properties.list, refer to Available system properties.

      Note: Administrators can disable or enable the syntax editor for all users, regardless of user preference.

      Searching for errors by line

      To locate the exact position of the error in a large script, click the Go to line icon.

      This feature is particularly useful when you are encounter a syntax error in a log file rather than in the ServiceNow record itself. In this case, you can navigate to the record and search for errors by line number. In the dialog box that appears, enter the line number of an error, and then click OK. Your view moves to the site of the error, and the cursor marks the correct line and column.

      Note: For this feature to function, you must disable the Syntax Editor.
      Figure 3. Go to script error

      Navigate to a line number

      When the syntax editor is disabled, users can navigate to a specific line in the code using the Go to line icon (The go to line icon).

      1. Click the Go to line icon (The go to line icon).
        Note: This icon is not available when the editor is enabled.
      2. Enter a number in the field and then press Enter.

      Syntax editor JavaScript support

      The syntax editor provides editing functions to support editing JavaScript scripts.

      JavaScript editing functions

      Icon Keyboard Shortcut Name Description
      N/A Toggle Syntax Editor Disables the syntax editor. Click the button again to enable the syntax editor.
      Access Key + R Format Code Applies the proper indentation to the script.
      Access Key + C Comment Selected Code Comments out the selected code.
      Access Key + U Uncomment Selected Code Removes comment codes from the selected code.
      N/A Check Syntax Checks the code for syntax errors. By default, the system automatically checks for syntax errors as you type in a script field. If an error or warning is found, the syntax editor displays a bullet beside the script line containing the error or warning. This check occurs on all script fields.
      Access Key + \ Start Searching Highlights all occurrences of a search term in the script field and locates the first occurrence. Click the icon, then enter the search term and press Enter. You can use regular expressions enclosed in slashes to define the search term. For example, the term /a{3}/ locates aaa.
      Access Key + [ Find Next Locates the next occurrence of the current search term in the script field. Use Start Searching to change the current search term.
      Access Key + ] Find Previous Locates the previous occurrence of the current search term in the script field. Use Start Searching to change the current search term.
      Access Key + W Replace Replaces the next occurrence of a text string in the script field.
      1. Click the icon, then enter the string to replace and press Enter. You can use regular expressions enclosed in slashes to define the string to replace. For example, the term /a{3}/ locates aaa.
      2. Enter the replacement string and press Enter.
      Access Key + ; Replace All Replaces all occurrences of a text string in the script field.
      1. Click the icon, then enter the string to replace and press Enter. You can use regular expressions enclosed in slashes to define the string to replace. For example, the term /a{3}/ locates aaa.
      2. Enter the replacement string and press Enter.
      N/A Save Saves changes without leaving the current view. Use this button in full screen mode to save without returning to standard form view.
      Access Key + L Toggle Full Screen Mode Expands the script field to use the full form view for easier editing. Click the button again to return to standard form view. This feature is not available for Internet Explorer.
      Access Key + P Help Displays the keyboard shortcuts help screen.

      JavaScript editing tips

      • To fold a code block, click the minus sign beside the first line of the block. The minus sign only appears beside blocks that can be folded. To unfold the code block, click the plus sign.
      • To insert a fixed space anywhere in your code, press Tab.
      • To indent a single line of code, click in the leading white space of the line and then press Tab.
      • To indent one or more lines of code, select the code and then press Tab. To decrease the indentation, press Shift + Tab.
      • To remove one tab from the start of a line of code, click in the line and press Shift + Tab.

      JavaScript resources

      Scripts use ECMA 262 standard JavaScript. Helpful resources include:

      • Mozilla: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference
      • ECMA Standard in PDF format: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
      • History and overview: http://javascript.crockford.com/survey.html
      • JavaScript number reference: http://www.hunlock.com/blogs/The_Complete_Javascript_Number_Reference

      Context menu

      Enable the context menu for script includes, Glide APIs, and tables in the JavaScript editor.

      With the context menu options, your users can navigate to:
      • Script include definitions
      • Glide API documentation
      • System and custom table definitions and data

      In the syntax editor, bold font is used for tokens that have a context menu. Right-click the token to view context menu options. If you use a Mac, you can use the Command-click shortcut.

      Table 2. Context menu options
      Token type Context menu option Description
      Script include Open Definition Definition of the script include in a new window.
      Find References List of files referencing the script include.
      Note:
      • To view the preview of the file, click the preview script icon Preview script icon.
        • To open the file in a new window, click Open File.
      • To view all files that reference the script include, click Show All Files.
      Glide API Show Documentation Documentation page of the Glide API.
      Table Show Definition Definition of the system or custom table in a new window.
      Show Data Records in the table that are based on the role of the current user.
      Enable or disable the context menu in the script editor using the glide.ui.syntax_editor.context_menu property in the System Property [sys_properties] table. See Available system properties for more information.
      Note: Context menu options can be accessed only if the browser supports SharedWorker. For example, Google Chrome and Mozilla Firefox.

      Syntax editor macros

      Script macros provide shortcuts for typing commonly used code. To insert macro text into a script field, enter the macro keyword followed by the Tab.

      vargr
      • Description: Inserts a standard GlideRecord query for a single value.
      • Output:
        var now_GR = new GlideRecord("");
        now_GR.addQuery("name", "value");
        now_GR.query();
        if (now_GR.next()) {
                        
        }
                      
      vargror
      • Description: Inserts a GlideRecord query for two values with an OR condition.
      • Output:
        var now_GR = new GlideRecord('');
                        
        var qc = now_GR.addQuery('field', 'value1');
                        
        qc.addOrCondition('field', 'value2');
        now_GR.query();
                        
        while (now_GR.next()) {
                        
                        
        }
                      
      for
      • Description: Inserts a standard recursive loop with an array.
      • Output:
        for (var i=0; i< myArray.length; i++) {
         //myArray[i];
         
        }
      info
      • Description: Inserts a GlideSystem information message.
      • Output:
        gs.addInfoMessage("");
      method
      • Description: Inserts a blank JavaScript function template.
      • Output:
        /*_________________________________________________________________
           * Description:
           * Parameters:
           * Returns:
           ________________________________________________________________*/
           : function() {
           
           },
        
      doc
      • Description: Inserts a comment block for describing a function or parameters.
      • Output:
        /**
                        
         * Description: 
                        
         * Parameters: 
                        
         * Returns:
        */

      Script syntax error checking

      All script fields provide controls for checking the syntax for errors and for locating the error easily when one occurs. The script editor places the cursor at the site of a syntax error and lets you search for errors in scripts by line number.

      Figure 4. Script syntax check

      The script editor notifies you of syntax errors in your scripts in the following situations.

      • Save a new record or update an existing record. A banner appears at the bottom of the editor showing the location of the first error (line number and column number), and the cursor appears at the site of the error. Warnings presented at Save or Update show only one error at a time.
        Figure 5. Script syntax error (short)
      • Click the syntax checking icon before saving or updating a record. A banner appears at the bottom of the editor showing the location of all errors in the script, and the cursor appears at the site of the first error.
        Figure 6. Script syntax error

      Syntax editor keyboard shortcuts and actions

      The syntax editor offers keyboard shortcuts and actions to assist in writing code.

      Table 3. Syntax editor keyboard shortcuts and actions for writing code
      Keyboard shortcut or action Description Example
      Write code

      Scripting assistance

      Control+Spacebar

      Displays a list of valid elements at the insertion point such as:
      • Class names
      • Function names
      • Object names
      • Variable names

      Double-click an entry to add it to the script.

      A line of code for a variable definition with a pop-up window displaying potential scripting elements.
      Enter a period character after a valid class name.

      Displays a list methods for the class.

      Double-click an entry to add it to the script.

      A line of code for a variable definition with a pop-up window displaying potential scripting elements.
      Enter an open parenthesis character after a valid class, function, or method name.

      Displays the expected parameters for the class or method.

      Enter the expected parameters as needed.

      A line of code for a variable defining a method call. There is a pop-up window displaying potential scripting elements.

      Toggle full screen mode

      Control+M

      Switches between displaying the form with the full screen and displaying it normally.
      Format code
      • Windows: Control+Shift+B
      • Mac: Command+Shift+B
      Formats the selected lines to improve readability.
      Several lines of unformatted code
      Several lines of code formatted for readability
      Toggle comment
      • Windows: Control+/
      • Mac: Command+/
      Adds or removes the comment characters // from the selected lines.
      A line of code selected with no comment characters
      A line of code selected with comment characters added to the front of the line.
      Insert macro text
      1. In the Script field, type the macro keyword text. For example help.
      2. Press Tab.
      Inserts macro text at the current position.
      A line of code containing the string help.
      The macro text for help added to the script.
      Search
      Start search
      • Windows: Control+F
      • Mac: Command+F

      Highlights all occurrences of a search term in the script field and locates the first occurrence.

      You can create regular expressions by enclosing the search terms between slash characters . For example, the search term /a{3}/ locates the string aaa .

      A search field with the term gr.
      The search results of the search term gr displaying four highlighted items. The first search result is selected.
      Find next
      • Windows: Control+G
      • Mac: Command+G
      Locates the next occurrence of the current search term in the script field. Use Start Searching to change the current search term.
      The search results of the search term gr displaying four highlighted items. The second search result is selected.
      Find previous
      • Windows: Control+Shift+G
      • Mac: Command+Shift+G
      Locates the previous occurrence of the current search term in the script field. Use Start Searching to change the current search term.
      The search results of the search term gr displaying four highlighted items. The first search result is selected.
      Replace
      • Windows: Control+E
      • Mac: Command+E
      Replaces the next occurrence of a text string in the script field.
      A replace field with the string gr.
      A replace with field with the string gl.
      A replace confirmation dialog with options for Yes, No, and Stop
      Replace all
      • Windows: Control+;
      • Mac: Command+;
      Replaces all occurrences of a text string in the script field.
      A replace field with the search term gr.
      A replace with field with the string gl.
      Help
      Help
      • Windows: Control+H
      • Mac: Command+H
      Displays the list of syntax editor keyboard shortcuts.
      A pop-up window displaying the keyboard shortcuts for the Syntax Editor.
      Show description
      • Windows: Control+J
      • Mac: Command+J
      Displays API documentation for the scripting element at the cursor's current location.
      A line of code selected with a pop-up window displaying API help for the GlideRecord object
      Show macros
      1. In the Script field, type help.
      2. Press Tab.
      Displays the list of available syntax editor macros as text within the script field.
      A line of code containing the string help.
      The macro text for help added to the script.

      Tags:

      Feedback

          Share this page

          Got it! Feel free to add a comment
          To share your product suggestions, visit the Idea Portal.
          Please let us know how to improve this content

          Check any that apply

          To share your product suggestions, visit the Idea Portal.
          Confirm

          We were unable to find "Coaching" in Jakarta. Would you like to search instead?

          No Yes
          • Contact Us
          • Careers
          • Terms of Use
          • Privacy Statement
          • Sitemap
          • © ServiceNow. All rights reserved.

          Subscribe Subscribed Unsubscribe Last updated: Tags: January February March April May June July August September October November December No Results Found Versions Search preferences successfully updated My release version successfully updated My release version successfully deleted An error has occurred. Please try again later. You have been unsubscribed from all topics. You are now subscribed to and will receive notifications if any changes are made to this page. You have been unsubscribed from this content Thank you for your feedback. Form temporarily unavailable. Please try again or contact  docfeedback@servicenow.com  to submit your comments. The topic you requested does not exist in the release. You were redirected to a related topic instead. The available release versions for this topic are listed There is no specific version for this documentation. Explore products Click to go to the page. Release notes and upgrades Click to open the dropdown menu. Delete Remove No selected version Reset This field is required You are already subscribed to this topic Attach screenshot The file you uploaded exceeds the allowed file size of 20MB. Please try again with a smaller file. Please complete the reCAPTCHA step to attach a screenshot
          Log in to personalize your search results and subscribe to topics
          No, thanks Login