Define script variables for a topic
Use the Variables sidebar to define script variables for a topic. Script variables can store information that is not found in ServiceNow tables. This information can then be shared elsewhere in a topic.
Before you begin
Role required: virtual_agent_admin or admin
About this task
For more information about writing scripts for Virtual Agent, see Virtual Agent scripts.
Procedure
-
Navigate to All > Conversational Interfaces > Assistant Designer.
-
Select the Asset library tab.
-
On the home page, open an existing topic or create a new one.
The Flow tab displays the conversation flow.
-
In the sidebar, select the Variables tab, then select the Script plus icon [Omitted image "icon-plus-clear.png"] Alt text:.
-
On the form, fill in the fields.
Field Description Variable name Name of the variable. The name is case-sensitive. Spaces in the name are replaced with an underscore character. Default value Default value for the variable. You can use either a static value or a script that specifies a dynamic value for this variable. -
Select Save.
Parent Topic:Build conversations in the Asset library in Assistant Designer
---
title: Define script variables for a topic
description: Use the Variables sidebar to define script variables for a topic. Script variables can store information that is not found in ServiceNow tables. This information can then be shared elsewhere in a topic.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/conversational-interfaces/virtual-agent/define-script-variables-topic.html
release: brazil
product: Virtual Agent
classification: virtual-agent
topic_type: task
last_updated: "2026-09-10"
reading_time_minutes: 1
keywords: [Variables, sidebar, script, topic, Virtual Agent designer]
breadcrumb: [Creating a Virtual Agent topic, Build conversations, Virtual Agent, Conversational Interfaces]
---
# Define script variables for a topic
Use the Variables sidebar to define script variables for a topic. Script variables can store information that is not found in ServiceNow tables. This information can then be shared elsewhere in a topic.
## Before you begin
Role required: virtual\_agent\_admin or admin
## About this task
For more information about writing scripts for Virtual Agent, see [Virtual Agent scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/conversational-interfaces/virtual-agent/virtual-agent-scripts.md).
## Procedure
1. Navigate to **All** > **Conversational Interfaces** > **Assistant Designer**.
2. Select the **Asset library** tab.
3. On the home page, open an existing topic or create a new one.
The **Flow** tab displays the conversation flow.
4. In the sidebar, select the Variables tab, then select the **Script** plus icon \[Omitted image "icon-plus-clear.png"\] Alt text:.
5. On the form, fill in the fields.
|Field|Description|
|-----|-----------|
|Variable name|Name of the variable. The name is case-sensitive. Spaces in the name are replaced with an underscore character.|
|Default value|Default value for the variable. You can use either a static value or a script that specifies a dynamic value for this variable.|
6. Select **Save**.
**Parent Topic:**[Build conversations in the Asset library in Assistant Designer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/conversational-interfaces/virtual-agent/conversation-designer-virtual-agent.md)
| title | Define script variables for a topic |
| description | Use the Variables sidebar to define script variables for a topic. Script variables can store information that is not found in ServiceNow tables. This information can then be shared elsewhere in a topic. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/conversational-interfaces/virtual-agent/define-script-variables-topic.html |
| release | brazil |
| product | Virtual Agent |
| classification | virtual-agent |
| topic_type | task |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| keywords | VariablessidebarscripttopicVirtual Agent designer |
| breadcrumb | Creating a Virtual Agent topicBuild conversationsVirtual AgentConversational Interfaces |