> 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. # goto > Jumps to a defined label in the current SWML section. Jump to a `label` within the current section, optionally based on a condition. The `goto` method will only navigate to a label within the same section. ## **Properties** **`goto`** `object` — required An object that accepts the following properties. --- **`goto.label`** `string` — required The label in section to jump to. --- **`goto.when`** `string` A JavaScript condition that determines whether to perform the jump. If the condition evaluates to true, the jump is executed. If omitted, the jump is unconditional. --- **`goto.max`** `integer` — default: 100 The maximum number of times to jump, from the minimum of `1` to max `100` jumps. --- ## **Examples** ### Loop with max #### YAML ```yaml version: 1.0.0 sections: main: - label: foo - play: url: 'say: This speech will be repeated 4 times.' - goto: label: foo max: 3 ``` #### JSON ```json { "version": "1.0.0", "sections": { "main": [ { "label": "foo" }, { "play": { "url": "say: This speech will be repeated 4 times." } }, { "goto": { "label": "foo", "max": 3 } } ] } } ``` ### Loop if a condition is satisfied #### YAML ```yaml version: 1.0.0 sections: main: - label: foo - play: url: 'say: This is some text that will be repeated 4 times.' - set: do_loop: true - goto: label: foo when: do_loop === true max: 3 ``` #### JSON ```json { "version": "1.0.0", "sections": { "main": [ { "label": "foo" }, { "play": { "url": "say: This is some text that will be repeated 4 times." } }, { "set": { "do_loop": true } }, { "goto": { "label": "foo", "when": "do_loop === true", "max": 3 } } ] } } ``` > Jumps to a defined label in the current SWML section.