⚠ This page requires javascript enabled in browser
Automation / All products Automation / Global Actions / Logic Actions


Tag: SetVar

The action SetVar will let you assign a value to a variable or, in the case of a few "reserved" values, call specific value types on demand. Multiple variables can be set within the same script line.

<SetVar Expres1="Help" Expres2="Page"/>
<echo value="{%Expres1%}, {%Expres2%} {%date%}"/>

NoteVariables are NOT case sensitive.

Tag Attributes

AttributesAttribute ValueValue DescriptionComment
(name)User definableAny unreserved variable nameMandatory - Multiple variables can be defined within the same line. See script example below.
(value)User definableAny string or numberMandatory - Multiple variables can be defined within the same line. See script example below.

Reserved Variable Values

Variable NameDescriptionComment
DateCurrent date
TimeCurrent time
LoopIndexCurrent Loop iteration index
ListSizeCurrent Loop size
ListNameList in current loop processing
ListActionAction used in current loop
ListParam=XValue of parameter of corresponding List entry
CurFilePathFile folder containing the current automation script

Detailed Description

In the script below, a List action is employed. (For more information regarding Lists, see this page.)

    In the script above, a List named "MyList" is defined and comprises the databases "Mailtestcopy.nsf", "Mailtest2.nsf", "Mailtest.nsf", and "test.nsf". Because Echo is set to "false", only the Echo text specified in applicable script lines will show in the console. Within the 5 SetVar action lines that follow, there are 9 variables set: 2 that use reserved values, 6 whose values are set outright, and 1 whose value is another variable. A Loop action is triggered on the List named "MyList", and for each iteration of the Loop block the resulting Echo text will be shown in the console. Note the usage of reserved values within the Echo text itself.