---
sourceDocument: Australia Enable AI
sourceDocumentLink: https://www.servicenow.com/docs/r/australia/intelligent-experiences

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Enable AI

ft:clusterId :

    - platai

bundleId :

    - platai

workflow :

    - Platform


---

# Call a custom skill from a script

# Call a custom skill from a script {#ariaid-title1}

Release version: Australia  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Call a custom skill from a UI action script so that you can run the skill and use its output in your instance logic.

## Before you begin

Role required: admin

## Procedure

1. Navigate to AllSystem UIUI Actions.
2. Create a UI action.  
   For more information on creating UI actions, see [Create a UI action](https://www.servicenow.com/docs/access?context=t_EditingAUIAction&version=australia&pubname=australia-platform-administration&ft:locale=en-US).
3. Add your script.  
   The following script is an example. You can replace the variables with your data.

       var inputsPayload = {};

       // create the payload to deliver input data to the skill

       inputsPayload['input name'] = {

         tableName: 'table name',

         sysId: 'sys_id',

         queryString: ''

       };


       //create the request by combining the capability sys ID and the skill config sys ID

       var request = {

           executionRequests: [{

               payload: inputsPayload,

               capabilityId: 'capability sys id',

               meta: {

                   skillConfigId: 'skill config sys id'

               }

           }],

           mode: 'sync'

       };


       //run the custom skill and get the output in a string format
       try {
       var output = sn_one_extend.OneExtendUtil.execute(request)['capabilities'][request.executionRequests[0].capabilityId]['response'];
       var LLMOutput = JSON.parse(output).model_output;
       } catch(e) {
        gs.error(e);
        gs.addErrorMessage('Something went wrong while executing the skill.');
       }
       action.setRedirectURL(current);

**Related tasks**   

* [Create a skill](https://www.servicenow.com/docs/LKwxb28v59W_28ULmgLTkg "Create a custom skill for Otto. Custom skills extend the generative AI capabilities of Otto to fit your own use cases.")
* [Create a prompt](https://www.servicenow.com/docs/9Sb9G2tHYaTxJEgUaEZX0g "After you create a custom skill, create a prompt. The prompt defines the instructions that the skill sends to the LLM and the skill inputs that it uses.")
* [Use prompt assistance](https://www.servicenow.com/docs/BKzZKeozPhhC_WEW8cl03A "Use prompt assistance to start your prompt from an example in the prompt library or from a prompt that ServiceNow Otto generates.")
* [Test a prompt](https://www.servicenow.com/docs/iFT3SY_7Wm85oXlh0N7ndg "After you create a prompt for your custom skill, test it before you finalize it to verify that it returns the expected results.")
* [Evaluate a prompt](https://www.servicenow.com/docs/seUSWWx6xYOAQ3Duff4jig "Use the AI Skill Kit evaluation tools to measure how your skill prompts perform against a dataset, using automated metrics and human feedback.")
* [Finalize and publish a skill](https://www.servicenow.com/docs/BJGUHiV2QSMt_6N4aFfrcQ "Finalize at least one prompt and publish your custom skill so that a Otto admin can activate it.")
* [Activate a skill](https://www.servicenow.com/docs/6tjeJEpB9pCt6ypF5ez6Mg "After you create and publish a custom skill, you must activate it in AI Admin Hub. Activating the skill enables you to trigger the skill within the UI.")

*[\>]: and then


