Call a custom skill from a script
task brazil Updated Sep 10, 2026 1 min read call-custom-skill-from-script.md
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
-
Navigate to All > System UI > UI Actions.
-
Create a UI action.
For more information on creating UI actions, see Create a UI action.
-
Add your script.
The following script is an example. You can replace the variables with your data.
JavaScriptvar 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 formattry {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);
Parent Topic:Using AI Skill Kit
Related topics
105 lines · 2.6 KB
---
title: Call a custom skill from a script
description: Call a custom skill from a UI action script so that you can run the skill and use its output in your instance logic.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/intelligent-experiences/now-assist-skill-kit/call-custom-skill-from-script.html
release: brazil
product: Now Assist Skill Kit
classification: now-assist-skill-kit
topic_type: task
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Using AI Skill Kit, AI Skill Kit, Generative AI skills, Enable AI Experiences]
---
# Call a custom skill from a script
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 **All** > **System UI** > **UI Actions**.
2. Create a UI action.
For more information on creating UI actions, see [Create a UI action](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/platform-administration/t_EditingAUIAction.md).
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);
```
**Parent Topic:**[Using AI Skill Kit](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/intelligent-experiences/now-assist-skill-kit/using-now-assist-skill-kit.md)
**Related topics**
[Create a skill]()
[Create a prompt]()
[Use prompt assistance]()
[Test a prompt]()
[Evaluate a prompt]()
[Finalize and publish a skill]()
[Activate a skill]()
| title | Call a custom skill from a script |
| description | Call a custom skill from a UI action script so that you can run the skill and use its output in your instance logic. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/intelligent-experiences/now-assist-skill-kit/call-custom-skill-from-script.html |
| release | brazil |
| product | Now Assist Skill Kit |
| classification | now-assist-skill-kit |
| topic_type | task |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Using AI Skill KitAI Skill KitGenerative AI skillsEnable AI Experiences |