Launching tutorial
This topic guides you through the process of developing a script designed for launching. The script includes elements of attended automation.
In this example, you will create a script that receives input from the user, writes to an Excel file and saves the file in the folder that the user chooses to save.
Before you begin
- You must have an IBM RPA Studio license.
- Read more about attended automation in Overview of attended automation.
Contents
Developing the script
-
Open IBM RPA Studio and enter your login and password information, if you're not logged in.
-
Click New > Wal File, or use the Alt + Shift + W shortcut to create a new script.
-
From the Toolbox, add the Input Box (
inputBox
) command. -
In the command window that opens, enter the following values:
- In Title, type "Enter text".
- In Prompt, type "Enter your name:".
- In the Text path, enter the name of a variable such as
name
. - Click Save to close the command window.
-
Add the Input Box (
inputBox
) command again, with the following values:- In Title, type "Enter text".
- In Prompt, type "Enter your age:".
- In the Text path, enter the name of a variable such as
age
. - Click Save to close the command window.
-
Add the Input Box (
inputBox
) command once more to get the user's email:- In Title, type "Enter text".
- In Prompt, type "Enter your email:".
- In the Text path, enter the name of a variable such as
email
. - Click Save to close the command window.
-
Create a
Data Table
type of variable:- In the IBM RPA Studio Home tab, on the Edit section, click the New variable button, or use the Alt + Shift + V shortcut to create a new variable.
- In Name, type "dataTable".
- In Variable Type, select
Data Table
. - Click Save to save the variable.
-
Add the Add Column (
addColumn
) command.- In Data Table, click the folder icon next the input box and double-click the
dataTable
variable to select it. - In Column Name, type "Name".
- Click Save to close the command window.
- In Data Table, click the folder icon next the input box and double-click the
-
Add the Add Column (
addColumn
) command again.- In Data Table, click the folder icon next the input box and double-click the
dataTable
variable to select it. - In Column Name, type "Age".
- Click Save to close the command window.
- In Data Table, click the folder icon next the input box and double-click the
-
Add the Add Column (
addColumn
) command once more.- In Data Table, click the folder icon next to the input box and double-click the
dataTable
variable to select it. - In Column Name, type "Email".
- Click Save to close the command window.
- In Data Table, click the folder icon next to the input box and double-click the
-
Add the Add Row (
addRow
) command.- In Data Table, click the folder icon next to the input box and double-click the
dataTable
variable to select it. - In Values mapping, click the plus icon three times to add three rows to input the values.
- In the first row, enter "Name" in the Parameter field and in the Value field, click the folder icon and select the
name
variable. - In the second row, enter "Age" in the Parameter field and in the Value field, click the folder icon and select the
age
variable. - In the third row, enter "Email" in the Parameter field and in the Value field, click the folder icon and select the
email
variable.
- In Data Table, click the folder icon next to the input box and double-click the
-
Add the Select Folder (
selectFolder
) command.- In Text, type "Enter the folder to save your file:".
- In Path, enter the name of a variable such as
outputFolder
. - Click Save to close the command window.
-
Add the Open Excel File (
excelOpen
) command.- In File path, click the folder icon next to the input box and select the
outputFolder
variable. Then, append "\userdata.xlsx" to the "${outputFolder}
" value. The field should read:${outputFolder}\userdata.xlsx
. - In the Excel instance output, enter a variable name such as
excelFile
. - Click Save to close the command window.
- In File path, click the folder icon next to the input box and select the
-
Add the Insert Data Table into Excel File (
excelSetTable
) command.- In Data table, click the folder icon next to the input box and select the
dataTable
variable. - Enable the Has headers parameter.
- In File, click the folder icon next to the input box and select the
excelFile
variable. - Enable the Use first sheet parameter.
- Leave Row and Column as 1. This means that the data is added starting from the first row and first column of in the Excel file.
- Click Save to close the command window.
- In Data table, click the folder icon next to the input box and select the
-
Add the Close Excel File (
excelClose
) command.- In File, click the folder icon next to the input box and select the
excelFile
variable. - Enable the Save parameter to save the data written to the file.
- Click Save to close the command window.
- In File, click the folder icon next to the input box and select the
The final script should look like the image below with the Variables visible option enabled in the IBM RPA Studio:
After these steps, save and run the script on debug mode to make sure it runs properly before you proceed.
Publishing the script
After you make sure that the script runs, now it is time to publish the script. The IBM RPA Launcher can only launch published scripts.
Follow the procedure to publish your script.
- In the IBM RPA Studio Home tab, in the File section, click the Publish button.
- In the window that opens, enter "userExcelData" in the Name field.
- In Description, write a brief description of what the script does. In this example, the description reads: "Reads inputs from a user and writes to the folder chosen by the user.".
- Enable the Set as production parameter.
❕ Important: If this is not enabled, the IBM RPA Launcher is unable to locate the script in the IBM RPA Control Center and it throws an error message. - Click Publish to publish your script.
To check if the script was successfully published, you must see the green checkmark next to the script's filename:
Another way to check if the script was published is to look for it in the IBM RPA Control Center:
- Open the IBM RPA Control Center and enter your login information.
- Click the Scripts option, under the Manage section.
- Search for the name of your script in the page.
Configuring the launcher
The script does not automatically appear in the IBM RPA Launcher unless you configure it as a launcher. Follow the procedure to configure it:
- Open the IBM RPA Control Center and enter your login information.
- Click the Launchers option, under the Define section.
- In the Define launchers page, click the Create launcher button.
- For IBM RPA 21.0.2 and older: In Computer groups, select the group of computers to launch the script. To learn how to manage computer groups, see Managing computer groups.
- Starting from IBM RPA 21.0.3: In Teams with launcher usage, select the teams that can access the script. See more about teams in the Managing teams page.
- Click Next > Add button to create a button for the launcher.
- Click Next > Add button to create a button for the launcher.
- In Name, enter a name to the launcher button.
- In Description, enter a brief description about the script.
- In Scripts, select the
userExcelData
script. - Select the Use preset icon option.
- Click Save.
- Click Create to finish the process.
You are now ready to launch the script.
Launching the script
- Open the IBM RPA Launcher and enter your login information.
- Look for the
userExcelData
button and double-click it to start. - If the button does not appear, refresh the page by pressing F5 and try again.