---
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


---

# Using extension points to extend application functionality

# Using extension points to extend application functionality {#ariaid-title1}

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

Use extension points to extend the functionality of an application without altering the
original application code. You can use pre-existing extension points available in selected ServiceNow AI Platform applications, or you can add
extension points when you develop custom applications in your own instance.

## Using extension points {#extension-points__section_blc_wft_pdb}

By using extension points, you can integrate customizations without actually altering the
core components in the application code. Extension points can prevent your custom code
interactions from breaking, which often occurs after an upgrade if you directly embed the
custom code into the application code.

Extension points that are embedded in the application code act as out-points, where data
passes to the custom code, and as in-points that handle the returned results. When creating
an application, the returned data or objects must conform to the requirements that you
define for the extension point.  
Note:  
Some out-of-box configured CSM Query Rules cannot be changed or disabled because they are also used in constants within a business rule.

## Types of extension points {#extension-points__section_zm3_dvf_kgb}

You can create extension points to process the custom code that uses the following types of artifacts:

Scripted extension points
:   Extension points in server-side script includes that store JavaScript functions and
    object classes. To learn about scripts includes and how to implement scripted
    extension points in the application and custom code, see:  
    * [Script includes](https://servicenow-prod.fluidtopics.net/i5uQxl1FIiH~ZUE4r4dqwQ#c_ScriptIncludes "Script includes are used to store JavaScript that runs on the server.")
    * [Creating and adding a scripted extension point](https://servicenow-prod.fluidtopics.net/J1XjyKiBCs8FEReMr18DGA "When developing an application, create scripted extension points and add them to the script includes in the application code. Use a scripted extension point to designate the specific location where data or objects can be sent to a registered custom script include and where returned results are processed.")
    * [Using extension points to extend application functionality](https://servicenow-prod.fluidtopics.net/agUCalbZ4ypHMncaJXRaoQ "Use extension points to extend the functionality of an application without altering the original application code. You can use pre-existing extension points available in selected ServiceNow AI Platform applications, or you can add extension points when you develop custom applications in your own instance.")
    {#extension-points__ul_vr2_kyc_cgb}

UI extension points

:   Extension points that are used in server-side UI macros such as HTML extensions. UI macros are discrete scripted components that you can add to the user interface. You use them to add custom content to a UI page, without having to directly modify the page. For example, you can use UI macros to add headers and footers to the standard Knowledge Base View (kb_view) UI page in which KB articles appear.

    To learn about UI macros and how to implement UI extension points in the application and custom code, see:

    * [UI macros](https://servicenow-prod.fluidtopics.net/~qIUyqeIRdrSnlC1RcqGNQ#c_UIMacros "UI macros are discrete scripted components administrators can add to the user interface.")
    * [Creating and adding a UI extension point](https://servicenow-prod.fluidtopics.net/4LJExZGDi3osOOz7SVk4rw#impl-ui-ext-pts-base-code "When developing an application, create UI extension points and add them to the server-side UI macros, such as HTML extensions, or the UI pages in the base application code.")
    * [Using extension points to extend application functionality](https://servicenow-prod.fluidtopics.net/agUCalbZ4ypHMncaJXRaoQ "Use extension points to extend the functionality of an application without altering the original application code. You can use pre-existing extension points available in selected ServiceNow AI Platform applications, or you can add extension points when you develop custom applications in your own instance.")
    {#extension-points__ul_csp_ncd_cgb}

Client extension points

:   Extension points that are used in client-side UI scripting, typically for modifying forms. UI scripts enable you to package client-side JavaScript into a reusable form, which is similar to how script includes store server-side JavaScript. You can create UI scripts and run them from client scripts, from other client-side script objects, and from HTML code.

    To learn about UI scripts and how to implement client extension points in application and custom code, see:

    * [UI scripts](https://servicenow-prod.fluidtopics.net/wRIgGGLtuNffgOnKwS5uEw#c_UIScripts "UI scripts provide a way to package client-side JavaScript into a reusable form, similar to how script includes store server-side JavaScript. Administrators can create UI scripts and run them from client scripts and other client-side script objects and from HTML code.")
    * [Creating and adding a client extension point](https://servicenow-prod.fluidtopics.net/fBC~DumrG4kXzJyvXX2vHQ "Create client extension points and add them to the client-side UI scripts in the base application code.")
    * [Using extension points to extend application functionality](https://servicenow-prod.fluidtopics.net/agUCalbZ4ypHMncaJXRaoQ "Use extension points to extend the functionality of an application without altering the original application code. You can use pre-existing extension points available in selected ServiceNow AI Platform applications, or you can add extension points when you develop custom applications in your own instance.")
    {#extension-points__ul_yvg_rcd_cgb}

When you use extension points to process customizations, you create a defined structure for
integrating custom data or functionality into an application. Custom server-side script
includes, UI macros such as HTML extensions, and client-side UI scripts are all external to
the application code and only interact with it at specified extension points.

## Application code {#extension-points__section_a2j_wgy_xgb}

The term application code refers to:

Standard application code
:   Standard, or base, application code that comprises the ServiceNow AI Platform.  
    Pre-defined extension points are already embedded in certain applications, such as Customer Service Management and Field Service Management. To learn more about the ServiceNow AI Platform applications that contain pre-defined extension points, see the following:{#extension-points__table_qqv_xzh_zgb__entry__2}

    | Application | Extension point topic |
    |-|-|
    | Coaching | [Coaching troubleshooting](https://www.servicenow.com/docs/access?context=coaching-troubleshooting&version=xanadu&pubname=xanadu-it-service-management&ft:locale=en-US) |
    | Continual Improvement Management | [Improvement with other applications](https://www.servicenow.com/docs/access?context=cim-integration&version=xanadu&pubname=xanadu-it-service-management&ft:locale=en-US) |
    | Customer Service Management | [Extension points in Customer Service Management](https://www.servicenow.com/docs/access?context=extension-points-customer-service&version=xanadu&pubname=xanadu-customer-service-management&ft:locale=en-US) |
    | Customer Service Management | [Creating custom user roles](https://www.servicenow.com/docs/access?context=creating-custom-csm-user-roles&version=xanadu&pubname=xanadu-customer-service-management&ft:locale=en-US) |
    | Customer Service Management | [CSM integration with Change Management](https://www.servicenow.com/docs/access?context=csm-integration-sm-change&version=xanadu&pubname=xanadu-customer-service-management&ft:locale=en-US) |
    | Customer Service Management | [CSM integration with Incident Management](https://www.servicenow.com/docs/access?context=csm-integration-sm-incident&version=xanadu&pubname=xanadu-customer-service-management&ft:locale=en-US) |
    | Customer Service Management | [CSM integration with Problem Management](https://www.servicenow.com/docs/access?context=csm-integration-sm-problem&version=xanadu&pubname=xanadu-customer-service-management&ft:locale=en-US) |
    | Customer Service Management | [CSM integration with Request Management](https://www.servicenow.com/docs/access?context=csm-integration-sm-request&version=xanadu&pubname=xanadu-customer-service-management&ft:locale=en-US) |
    | Field Service Management | [Extension points in Field Service Management](https://www.servicenow.com/docs/access?context=extension-points-field-service&version=xanadu&pubname=xanadu-field-service-management&ft:locale=en-US) |
    | Knowledge Management | [Use extension points for Knowledge Management](https://www.servicenow.com/docs/access?context=extension-points-km-plugins&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US) |
    | Orchestration | [Client software distribution extension network](https://www.servicenow.com/docs/access?context=c_CSDExtensionFramework&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US) [Installed with client software distribution](https://www.servicenow.com/docs/access?context=r_IWClientSWDist&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US) |
    | Password Reset | [Password Reset script includes](https://www.servicenow.com/docs/access?context=c_InstalledPasswordResetScripts&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US) |
    [ ]

    {#extension-points__table_qqv_xzh_zgb}

Internally developed custom applications for your enterprise
:   You can add extension points to handle the registration of custom artifacts that are
    used to modify or extend the functionality of an application. When developers create
    custom code, they register, or pair, specific custom artifacts with specific extension
    points. Adding extension points enables integration of future customizations without
    having to change your base code.

## Creating an extension point in the application code {#extension-points__section_mf1_3pg_sdb}

You want to ensure that the internally developed applications that you create for your
enterprise can be properly customized, combined, and upgraded as needed. Extension points
enable you to modify the functionality and user interface for an application without editing
its core components. Use of extension points also creates a highly defined structure for
functionality extensions.  
When you create an extension point, you can restrict its use to the application scope in which it is defined or specify that the extension point can run in all scopes globally. If the application scope is restricted, customizations that are registered against the extension point can only run in the designated application scope. Before designing and building an application that includes extension points, you should:

* Identify where to place extension points in the application code to accommodate custom script includes, UI macros, or UI scripts.
* Determine the content and structure for an extension point. This definition should describe how a customization should be structured, how it interacts with the application code, and how the data that is returned by a customization at the extension point is processed.
{#extension-points__ul_mz5_1hj_vdb}  
To create extension points and embed them in the application code, perform the following tasks:

1. Create an extension point and define its custom interface. This is an example of a scripted extension point.

2. Designate specific places in the application code where data or objects can be sent to a customization, and where data is returned.
3. Create an artifact, such as a script include, UI macro, or UI script, that calls the [GlideScriptedExtensionPoint - Scoped](https://servicenow-prod.fluidtopics.net/nTQSRl64SNz90DUTD4_EnA#GlideScriptedExtPtScopedAPI "The GlideScriptedExtensionPoint API provides a method that returns the extension instances associated with a specified extension point.") method. This method identifies the extension point at which registered custom artifacts execute in the application code.

{#extension-points__ol_ffm_c2g_pfb}

## Enabling debugging and logging {#extension-points__section_h5t_gty_xgb}

When you create a extension point, you should also enable debugging and logging. Debugging
and logging help you to identify and fix issues that are related to the use of custom
artifacts with an extension point. When you enable the debugger, you can set break points in
script includes, UI macros, or UI scripts. You can check the logs to see the following
details:

* When an extension point finds active extension instances, including the total number of extension instances found and the time each extension instance was found.
* When an extension point executes extension instances, including the total number of custom artifacts executed and the time of each executed. It also includes the total number that failed to execute and the time at which each extension instance failed.

{#extension-points__ul_wj3_vmr_rdb}  
Note:  
To learn more about how to enable debugging and how it works, 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.")
* [Debugging applications](https://servicenow-prod.fluidtopics.net/BH5d2XCGAAjvm3UmQF6QsQ#c_DebuggingApplications "Application developers can display debug messages about configuration records to help them troubleshoot issues. The Debug Scopes module provides information about the system switching between custom applications to run server-side scripts.")
* [Writing to the debug log](https://servicenow-prod.fluidtopics.net/oSHPhxMU8kgHHbGkR_kfmg#c_WritingToTheDebugLog "To write to the debug log in your client-side JavaScript, or UI policies, make a call to the global function jslog().")
{#extension-points__ul_rzj_psy_xgb}

## Registering a custom artifact against an extension point {#extension-points__section_up3_thj_vdb}

When you are customizing an application, you extend the base functionality by using custom
artifacts, such as server-side script includes, UI macros, or client-side UI scripts. To
design and build custom artifacts, perform the following tasks:  
1. Review the listing of available extension points that are appropriate to the specific type of custom artifact that you are creating.
   * These listings include extension points that you created and any pre-defined extension points that are embedded in the ServiceNow AI Platform functions.
   * Each listing includes information about an extension point in the application code that calls a custom artifact and what data or objects should be returned to it.
   {#extension-points__ul_wsn_hxf_kgb}
2. Select an extension point.
3. Determine how to structure the custom artifact. The structure should be based on the extension point descriptions. The descriptions include the requirements for using the artifact with the custom code and where the artifact will located in the base application code.
4. Create the custom artifact and code when you register it against the selected extension point. Through registration, you create an extension instance record that links the extension point definition to its implementation in the custom artifact.
{#extension-points__ol_xxk_nfg_pfb}

## How registered custom artifacts are processed {#extension-points__section_gnb_nqy_rdb}

When the application code executes and finds an embedded API call containing an extension point, it:

1. Uses the extension point in the API call to determine which custom artifacts are registered against it.
2. Sends the appropriate data or objects to the registered custom artifacts.
3. Collects the returned output from each custom artifact.
4. Processes and incorporates the returned results into the base application.
{#extension-points__ol_i1m_5vl_rdb}
* **[Using scripted extension points in server-side scripts](https://servicenow-prod.fluidtopics.net/_qmzAEN0qK~D7I9iQ53wZg)**   
  Use the scripted extension points in the server-side script includes that store JavaScript functions and object classes. By using extension points, you can integrate customizations without actually altering the core components in the application code.
* **[Using UI extension points in server-side UI macros](https://servicenow-prod.fluidtopics.net/O3WONY_D~xU4FAk8RSJRJA)**   
  Use UI extension points in the server-side UI macros, such as HTML extensions, to add custom content to a UI page without having to directly modify the page. By using UI extension points, you can integrate customizations without actually altering the core components in the application code.
* **[Using client extension points in client-side UI scripting](https://servicenow-prod.fluidtopics.net/Hr2Bo~AQW5_aZ92~POwGHw)**   
  Use client extension points in client-side UI scripting to modify forms, so that you do not have to directly modify the form. By using client extension points, you can integrate customizations without actually altering the core components in the application code.

