> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # set > Set script variables to the specified values. Set script variables to the specified values. Variables set using `set` can be removed using [`unset`](/docs/swml/reference/calling/unset). **`set`** `object` — required An object that accepts user-defined key-value pairs. --- ## **Variables** Any variable can be set by this method. ## **Examples** ### Setting variables #### YAML ```yaml version: 1.0.0 sections: main: - set: num_var: 1 - play: url: 'say: ${num_var}' - set: num_var: 2 - play: url: 'say: ${num_var}' ``` #### JSON ```json { "version": "1.0.0", "sections": { "main": [ { "set": { "num_var": 1 } }, { "play": { "url": "say: ${num_var}" } }, { "set": { "num_var": 2 } }, { "play": { "url": "say: ${num_var}" } } ] } } ``` ### Setting multiple variables #### YAML ```yaml version: 1.0.0 sections: main: - set: items: - drill bit - drill person: handyman systems: ventilation: - inlet - outlet - fans hr: - lucy - liam - luke - play: url: 'say: The items ${items} will be used by ${person} to fix ${systems.ventilation}.' ``` #### JSON ```json { "version": "1.0.0", "sections": { "main": [ { "set": { "items": [ "drill bit", "drill" ], "person": "handyman", "systems": { "ventilation": [ "inlet", "outlet", "fans" ], "hr": [ "lucy", "liam", "luke" ] } } }, { "play": { "url": "say: The items ${items} will be used by ${person} to fix ${systems.ventilation}." } } ] } } ``` ## **See Also** * **[Variables and Expressions](/docs/swml/reference/variables)**: Complete reference for SWML variables, scopes, and syntax * **[unset](/docs/swml/reference/calling/unset)**: Remove variables from the script > Set script variables to the specified values.