---
sourceDocument: Australia Enable AI
sourceDocumentLink: https://www.servicenow.com/docs/r/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 March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
You can use a script to call a custom skill.

## 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. Creating a custom skill enables you to have greater flexibility with Otto's generative AI capabilities.")
* [Create a prompt](https://www.servicenow.com/docs/9Sb9G2tHYaTxJEgUaEZX0g "After you create a custom skill, create a prompt. Creating a prompt enables you to choose what skill inputs to use, as well as the type of tool.")
* [Use prompt assistance](https://www.servicenow.com/docs/BKzZKeozPhhC_WEW8cl03A "Use prompt assistance to get a jump start with your prompt development by selecting an example from the prompt library or using ServiceNow Otto to generate one.")
* [Test a prompt](https://www.servicenow.com/docs/iFT3SY_7Wm85oXlh0N7ndg "After you create a prompt for your custom skill, test the prompt template before you finalize it. Testing the prompt verifies that you’re seeing the expected prompt results before it’s activated.")
* [Evaluate a prompt](https://www.servicenow.com/docs/seUSWWx6xYOAQ3Duff4jig "Use the AI Skill Kit evaluation tools to evaluate the effectiveness of your skill prompts.")
* [Finalize and publish a skill](https://www.servicenow.com/docs/BJGUHiV2QSMt_6N4aFfrcQ "When you’re satisfied with your prompt, you can publish your custom skill. Publishing the skill enables a Otto admin to activate it.")
* [Activate a skill](https://www.servicenow.com/docs/6tjeJEpB9pCt6ypF5ez6Mg "After you publish a skill, a Otto admin must activate it in AI Admin Hub. Activating the skill makes it available for users to trigger within the platform.")

*[\>]: and then


