# While Loop

The loop allows repeating a sequence of actions (blocks) multiple times while a condition, specified as an expression, is met. Each time the block is entered, the expression specified in the "Condition" property is checked, and if it is true, the execution of the scenario will continue towards the "Condition" exit of this block (into the so-called "loop body").

<figure><img src="https://3212714295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI0zUnKkOuy6lWt7DZ46u%2Fuploads%2Fgit-blob-b1c46a34370454d6ecd8a6b526e21c463b47855b%2F%D0%A6%D0%B8%D0%BA%D0%BB%20%D0%9F%D0%BE%D0%BA%D0%B0.png?alt=media" alt=""><figcaption></figcaption></figure>

As soon as the "Condition" no longer holds true during the next pass through this block, the scenario will continue towards the lower exit of the block. Don’t forget to connect the exit of the last block in the loop body to the entry of this block or any of the preceding blocks.

<table data-header-hidden><thead><tr><th width="249" valign="top"></th><th width="322" valign="top"></th></tr></thead><tbody><tr><td valign="top">Condition</td><td valign="top"><p>[Any type] While the specified expression evaluates to true, the loop will continue to execute.</p><p>An expression value equivalent to <code>0</code> (zero) or <code>$False</code> is considered false, while any other values are true. For example, if the variable <code>$a</code> was previously assigned the value <code>5</code>, then the condition <code>$a>2</code> is true, while the condition <code>$a == 6</code> is false.</p><p>The condition can contain mathematical and logical operations, constants, functions, other variables, etc. Examples of expressions that can be used in conditions are available by clicking the button <img src="https://3212714295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI0zUnKkOuy6lWt7DZ46u%2Fuploads%2Fgit-blob-0d96bd20a90084df9ffd002b2ac1f80e9d72361b%2F2025-06-02_22-27-49.png?alt=media" alt=""> next to the Condition property.</p></td></tr><tr><td valign="top">Error Handling Level</td><td valign="top"><p>Select the error handling level. Possible values:</p><ul><li>"Default" - default;</li><li>"Ignore" - errors are ignored;</li><li>"Handle" - errors are handled.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Exit Direction</td><td valign="top"><p>Select the exit direction from the block in case of an error. Possible values:</p><ul><li>"Default" - default;</li><li>"Right" - to the right;</li><li>"Bottom" - down.</li></ul><p>This property allows you to define the exit direction in case of errors for blocks that do not contain the "If Error" connector (for example, the "Condition" block).</p><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Message Level</td><td valign="top"><p>Select the message level that blocks will output during operation. Possible values:</p><ul><li>"Default" - default;</li><li>"Release" - output disabled;</li><li>"Debug" - main information output;</li><li>"Detailed" - detailed information output.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Error Text</td><td valign="top">[Text] Returns detailed information about the error in case of incorrect execution of the block's work.</td></tr></tbody></table>
