End If

Terminates a command block started by the If (if) command.

Command availability: IBM RPA SaaS and IBM RPA on premises


Start a command block with the If (if) 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 command block with the If (if) command block.

defVar --name studentAverage --type Numeric --value 8 --parameter
// Check the value of "studentAverage" and inform that you can participate in the draw, because this value is greater than 7.
if --left "${studentAverage}" --operator "Greater_Than" --right 7
    messageBox --title Grade --text "Congratulations! You can participate in the draw!" --icon "Information" --buttons "OK" --defaultbutton "FirstButton"
// At the end, the command block is closed.
logMessage --message "${studentAverage}" --type "Info"
// Display the value of "studentAverage" in the console.