Using Variable Properties
Learn how to use variable properties in your scripts.
The following tutorial guides you through the development of a simple script to demonstrate the use of variable properties. The scripts function is to add a new row to an Excel data table if the amount of rows is less than 10, using the properties
of the dataTable variable.
Using variable properties in your scripts
-
Log in to the IBM RPA Studio.
-
Click New > Wal File to create a new script.
-
From the Toolbox, add the Open Excel file (
excelopen) command to the script.- Enter the Excel file path in the File path parameter.
- Enable the Save changes option.
- Type
excelInstancein the Excel instance parameter.
-
Add the Get Excel Table (
excelgettable) command.- In the Excel instance parameter, click the folder icon and select the
excelInstancevariable. - Enable the Use First Spreadsheet and the Get Entire Table parameters.
- In the Table output parameter, enter the variable name
dataTable. - Click Save.
- In the Excel instance parameter, click the folder icon and select the
-
Add the If (
if) command. Note that the End If (endif) command is automatically inserted right after.- In the Left operand parameter, click the folder icon and click the play button icon on the
dataTablevariable, then double-click theRowsproperty. - In the Operator parameter, use the dropdown menu to select the Less than option.
- In the Right Operator parameter, type
10. - Click Save.

- In the Left operand parameter, click the folder icon and click the play button icon on the
-
Add the Add row (
addrow) command between the If and the End if commands.- Click the folder icon of the Data Table parameter and double-click the
dataTablevariable. - Click Save.
- Click the folder icon of the Data Table parameter and double-click the
-
Add the Close Excel file (
excelclose) command.- Enter the
excelInstancevariable in the File parameter. - Enable the Save? parameter and Save.
- Enter the