Benny's Secret Functions
How to use variables
Guide to Variables used in STU
How “Variables” work in STU and PAM
Format
{{GroupName.VariableName}}
{{GroupName.VariableName(index, function, and another variable)}}
Data Types
a. Omnipotent (String-base)
Variable data types get automatically converted into an appropriate type such as Integer, Float, and Date, when the data has been fed into an Operation.
3. Data Store Types
Simple Stores as one data and retrieves plainly with {{GroupName.VariableName}}
Array Stores as a series of data and retrieves with index {{GroupName.VariableName(5)}}
CSV Stores as a table of data and retrieves with column/row coordinates where the VariableName represents column and index represents row like {{GroupName.A(5)}} --- see more about CSV variable in the section right below.
4. CSV type variables
This type of variables can only be generated by the Plugin operations as one of the three Return Value options
When you want to use the column headers as Column names leave the check box checked just like in the example given above. Otherwise, columns are uppercase alphabets like A, B, C --- AA, AB and so on just like the notation in MS Excel.
5. Array type
You can create and define array variables in the Variable section in STU (lower left corner).
In the example given below, {{family.brothers}} and {{family.sisters}} are the array variables as they have the check boxes under array column checked.
6. Index
Index is integer (you can use variable) starting with 1
Examples
((family.brother(1))) or {{family.brother({{loop.count}})}}
7. Functions like COUNT, APPEND, and LAST are available.
They must be all uppercase letters.
COUNT shows you how many data exist in array or in a column of a CSV variable.
APPEND add a new data at the end of an existing array variable.
LAST retrieves the data at the end of the array variable.
Example
{{family.brothers(COUNT)}}
{{family.sisters(APPEND)}}
{{family.sisters(LAST)}}
8. The User Params operation in the Interactive group will generate its own variable.
9. Repeat counter variable.
The Repeat operation manages a local (Repeat specific) variable.
It is shown as {{rp.index}}
There are 3 types of Variables used in STU.
User defined variables
Plugin generated variables
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
{{group_name.variable_name}}
Double curly brackets in both front and the back and there is a . (period) in between group_name (your choice) and variable_name (your choice)