Terminates the command block started by the For (for) command.

Command availability: IBM RPA SaaS and IBM RPA on premises


This command can only be used with the For (for) 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 demonstrates how to use the For (for) and Next (next) commands to define a repetition structure.

defVar --name iterationVariable --type Numeric --value 0
// Performs the loop 10 times.
for --variable ${iterationVariable} --from 1 --to 10 --step 1
    logMessage --message "${iterationVariable}" --type "Info"
logMessage --message "Execution Finished\r\n" --type "Info"
// Result: Repeats the command block 10 times and displays the message "execution finished".