End While

Terminates a command block started by the While (while) command.

Command availability: IBM RPA SaaS and IBM RPA on premises


Start the command block with the While (while) command.

Script syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.



The following example shows how to start a repetition structure with the While (while) command block.

defVar --name counter --type Numeric --value 0
// Repeat the command block as long as "counter" is less than 5. At the end, the command block is closed.
while --left "${counter}" --operator "Less_Than" --right 5
    incrementVar --number ${counter}
    logMessage --message "Repetition Number: ${counter}" --type "Info"