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

Contents

Developing the script

  1. Open IBM RPA Studio and enter your login and password information, if you're not logged in.

  2. Click New > Wal File, or use the Alt + Shift + W shortcut to create a new script.

  3. From the Toolbox, add the Input Box (inputBox) command.

  4. In the command window that opens, enter the following values:

    1. In Title, type "Enter text".
    2. In Prompt, type "Enter your name:".
    3. In the Text path, enter the name of a variable such as name.
    4. Click Save to close the command window.
  5. Add the Input Box (inputBox) command again, with the following values:

    1. In Title, type "Enter text".
    2. In Prompt, type "Enter your age:".
    3. In the Text path, enter the name of a variable such as age.
    4. Click Save to close the command window.
  6. Add the Input Box (inputBox) command once more to get the user's email:

    1. In Title, type "Enter text".
    2. In Prompt, type "Enter your email:".
    3. In the Text path, enter the name of a variable such as email.
    4. Click Save to close the command window.
  7. Create a Data Table type of variable:

    1. 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.
    2. In Name, type "dataTable".
    3. In Variable Type, select Data Table.
    4. Click Save to save the variable.
  8. Add the Add Column (addColumn) command.

    1. In Data Table, click the folder icon next the input box and double-click the dataTable variable to select it.
    2. In Column Name, type "Name".
    3. Click Save to close the command window.
  9. Add the Add Column (addColumn) command again.

    1. In Data Table, click the folder icon next the input box and double-click the dataTable variable to select it.
    2. In Column Name, type "Age".
    3. Click Save to close the command window.
  10. Add the Add Column (addColumn) command once more.

    1. In Data Table, click the folder icon next to the input box and double-click the dataTable variable to select it.
    2. In Column Name, type "Email".
    3. Click Save to close the command window.
  11. Add the Add Row (addRow) command.

    1. In Data Table, click the folder icon next to the input box and double-click the dataTable variable to select it.
    2. In Values mapping, click the plus icon three times to add three rows to input the values.
    3. In the first row, enter "Name" in the Parameter field and in the Value field, click the folder icon and select the name variable.
    4. In the second row, enter "Age" in the Parameter field and in the Value field, click the folder icon and select the age variable.
    5. In the third row, enter "Email" in the Parameter field and in the Value field, click the folder icon and select the email variable.

    Add row command

  12. Add the Select Folder (selectFolder) command.

    1. In Text, type "Enter the folder to save your file:".
    2. In Path, enter the name of a variable such as outputFolder.
    3. Click Save to close the command window.
  13. Add the Open Excel File (excelOpen) command.

    1. 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.
    2. In the Excel instance output, enter a variable name such as excelFile.
    3. Click Save to close the command window.

    Open Excel File

  14. Add the Insert Data Table into Excel File (excelSetTable) command.

    1. In Data table, click the folder icon next to the input box and select the dataTable variable.
    2. Enable the Has headers parameter.
    3. In File, click the folder icon next to the input box and select the excelFile variable.
    4. Enable the Use first sheet parameter.
    5. 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.
    6. Click Save to close the command window.
  15. Add the Close Excel File (excelClose) command.

    1. In File, click the folder icon next to the input box and select the excelFile variable.
    2. Enable the Save parameter to save the data written to the file.
    3. Click Save to close the command window.

The final script should look like the image below with the Variables visible option enabled in the IBM RPA Studio:

Final script must look like this

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.

  1. In the IBM RPA Studio Home tab, in the File section, click the Publish button.
  2. In the window that opens, enter "userExcelData" in the Name field.
  3. 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.".
  4. 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.
  5. 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:

The script's filename should be followed by a green checkmark

Another way to check if the script was published is to look for it in the IBM RPA Control Center:

  1. Open the IBM RPA Control Center and enter your login information.
  2. Click the Scripts option, under the Manage section.
  3. Search for the name of your script in the page.

Check for the script in the IBM RPA Control Center

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:

  1. Open the IBM RPA Control Center and enter your login information.
  2. Click the Launchers option, under the Define section.
  3. In the Define launchers page, click the Create launcher button.
  4. 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.
  5. 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.
  6. Click Next > Add button to create a button for the launcher.
  7. Click Next > Add button to create a button for the launcher.
  8. In Name, enter a name to the launcher button.
  9. In Description, enter a brief description about the script.
  10. In Scripts, select the userExcelData script.
  11. Select the Use preset icon option.
  12. Click Save.
  13. Click Create to finish the process.

You are now ready to launch the script.

Launching the script

  1. Open the IBM RPA Launcher and enter your login information.
  2. Look for the userExcelData button and double-click it to start.
  3. If the button does not appear, refresh the page by pressing F5 and try again.