Return from Subroutine

Returns to the scope that called the subroutine.

Command availability: IBM RPA SaaS and IBM RPA on premises

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.



After the end of the instructions of a subroutine, the command returns to the main routine.

defVar --name file_path --type String
defVar --name text --type TextFileReader
defVar --name converted_text --type String
logMessage --message "Start of execution in the main method." --type "Info"
goSub --label readFile
logMessage --message "End of execution in the main method." --type "Info"
beginSub --name readFile
    logMessage --message "Executed subroutine" --type "Info"