Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel

Table of Contents
maxLevel3
stylenone


Guide to Variables used in STU



There are 3 types of Variables used in STU.

  1. User defined variables.
  2. Plugin generated variables
  3. Special variables


1. User defined variables

.

User Defined Variables are the ones that are defined in the Variable section of STU.

  


2. Plugin generated variables

Plugin/Operation generated variables are the variables specific to the Plugin when the Return Value of CSV has been selected.

One example is the User Param operation in the Interactive tool-group.

For most of plugin generated variables, Users get to define group name but the variable names are defined by the plugin itself.


In below example Folder_C becomes the group name of the variable.


Then in this example of File Monitor plugin, the variable names are Index, filepath, and filesize like described in its help document.


3. Special variables

 Special Variables are fixed in the STU system such as {{rp.index}} in the Repeat operation which holds the counter data.


VARIABLES


1. Notation


2. Examples

Define a "grp1" variable group like below in the 'User variables in Scenario'.

  • "grp1" including 3 variables, "var1","var2",and "var3".
Code Block
themeDJango
titleGroup Variable: grp1
{
	# Group variable name: "grp1"
	"grp1": {
		# simple variable (number)
		"var1": 100,

		# simple variable (string)
		"var2": "Hello World, Thank you for using ARGOS RPA+"

		# array 
		"var3": [ 1, "Hello", "World", "Thank you for choosing ARGOS RPA+" ]
	}
}
  • "grp2" including 3 variables, "var4","var5",and "var6".
Code Block
themeDJango
titleGroup Variable: grp2
{ 
	# Group variable name: "grp2"
	"grp2": {
		# simple variable (number)
		"var4": 30,

		# simple variable (string)
		"var5": "I am a Bot"

		# array
		"var6": { 2, "ARGOS RPA" }
}


Below are the variable notation examples and the actual value of the variable.

Variable Value Description 
{{grp1.var1}}100 actual value of simple variable "var1" of group variable "grp1"
{{grp1.var3(2)}}"Hello"the 2nd item of array variable "var3" of group variable "grp1"
{{grp1.var3(APPEND)}}
※ see below "How ot use APPEND"
{{grp1.var3(COUNT)}}4total number of items in the "grp1.var3" array variable. It is used as an index in "Repeat" action
{{grp1.var3(LAST)}}"Thank you for choosing ARGOS RPA+"the last item in the "grp1.var3" array variable
Hello {{grp1.var3(3)}} ! "Hello World!"Substitution. {{grp1.var3(3)}} placeholder is replaced with its actual value of array, "World


FUNCTIONS


1. COUNT

How to use "COUNT" in "Repeat"

'COUNT' can be used as an index in "Repeat".

See below.

When repeating same operations for all items in array, you have to know the total number of items in array variable. You can obtain it by using 'COUNT'.
For examples, "{{grp1.var3(COUNT)}}" means the total number of items of "{{grp1.var3}}" array variable.
The value of {{grp1.var3(COUNT)}} is "4".


2. APPEND

How to use "APPEND"

 Use case

  • 'Excel Basic' action
  • Result value of plugins

How to use "APPEND" in "Excel Basic"

Suppose you have a array variable that already has a values. 

In this example, I'll show you how to append "{{grp2.var2}}" (simple variable) and "{{grp2.var3}}" (array) to another array variable "{{grp1.var3}}".

Sample Excel Data for "grp2":


ABC
1var130
2var2I am a Bot
3var32ARGOS RPA


Ex1. Append "{{grp2.var2}}" (simple variable) to "{{grp1.var3}}" (array)

  1. Add "Excel Basic" action
  2. Choose "Read" in 'Read/Write'
  3. Select an excel file to read in STU
  4. (Option) Set 'Sheet name' (default: sheet1)
  5. Click "Add Item" 
  6. Set "Cell range" to "**B2**"
  7. Write "{{grp1.var3(APPEND)}}" in "Select variable" input box

※ To check out the result value of "{{grp1.var3}}", print on 'Notepad' by using 'Repeat" and 'TextInput' actions

ResultsDescription

1

Hello

World

Thank you for choosing ARGOS RPA+

I am a Bot




{{grp1.var3}} values

Appended value


Ex2. Append "**grp2.var6**" (array) to "grp1.var3" (array)

  1. Add "Excel Basic" action
  2. Choose "Read" in 'Read/Write'
  3. Select an excel file to read in STU
  4. (Option) Set 'Sheet name' (default: sheet1)
  5. Click "Add Item" 
  6. Set "Cell range" to "**B3:C3**"
  7. Write "**{{grp1.var3(APPEND)}}**" in "Select variable" input box
ResultsDescription

1

Hello

World

Thank you for choosing ARGOS RPA+

['2', 'ARGOS RPA']



Original {{grp1.var3}} values.

Appended value. Array converted to a simple variable automatically.

It is not a array but a simple variable.


How to use "APPEND" with return value of plugin

There are 3 types in the result type of plugins. Only 'string' can be used with 'APPEND'.

  1. Select the result type of plugin to 'string'
  2. Select 'Variable name' in variable table drop down menu. (ex) {{grp1.var3}}
  3. Edit variable name like "{{grp1.var3(APPEND)}}". <br>The returned value is appended to {{grp1.var3}}.