For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
ReferenceGuides
ReferenceGuides
  • Core
    • Introduction to SWML
    • Expressions
    • Template functions
    • Variables
    • Errors
  • Calling
    • Overview
    • ai
    • ai_sidecar
    • amazon_bedrock
    • answer
    • cond
    • connect
    • denoise
    • detect_machine
    • enter_queue
    • execute
    • goto
    • hangup
    • join_conference
    • join_room
    • label
    • live_transcribe
    • live_translate
    • pay
    • play
    • prompt
    • receive_fax
    • record
    • record_call
    • request
    • return
    • send_digits
    • send_fax
    • send_sms
    • set
    • sip_refer
    • sleep
    • stop_denoise
    • stop_record_call
    • stop_tap
    • switch
    • tap
    • transcribe
    • transcribe_stop
    • transfer
    • unset
    • user_event
  • Messaging
    • Overview
    • execute
    • goto
    • label
    • receive
    • reply
    • request
    • return
    • switch
    • transfer
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Variable
  • Examples
  • Unset a single variable
  • Unset multiple variables
  • See Also
Calling

unset

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

user_event

Next
Built with

Unset specified variables. The variables have been set either using the set command or as a byproduct of some other statements or methods (like record)

unset
string | string[]Required

The name of the variable to unset (as a string) or an array of variable names to unset.

Variable

Any variable can be unset by this method.

Examples

Unset a single variable

1version: 1.0.0
2sections:
3 main:
4 - set:
5 num_var: 1
6 - play:
7 url: 'say: The value of num_var is: ${num_var}.'
8 - unset: num_var
9 - play:
10 url: 'say: The value of num_var is ${num_var}.'

Unset multiple variables

1version: 1.0.0
2sections:
3 main:
4 - set:
5 systems:
6 hr:
7 - tracy
8 - luke
9 engineering:
10 john: absent
11 name: john
12 - play:
13 url: 'say: ${systems.hr}'
14 - unset:
15 - systems
16 - name
17 # this play statement emits an error because `systems` is undefined
18 # at this point so there's nothing for `play` to say.
19 - play:
20 url: 'say: ${systems}'

See Also

  • Variables and Expressions: Complete reference for SWML variables, scopes, and syntax
  • set: Set variables in the script