Variables
Variables are used as containers for data values. You need variables to transfer values to the label in Print Label action, or to use values in other data-manipulation actions. Typically, a filter extracts values from data streams received by trigger and sends values to variables. For more information, see section Understanding Filters.
Usually, you send values of variables to the label template, and print the label. The mechanism that sends values of variables to labels uses the automated name mapping. The value of the variable defined in the trigger is sent to the variable defined in the label that carries the same name. You can define variables using one of the three available methods:
-
Import variables from label file: As for the above explained automatic mapping, it makes a good practice to import your variables from the label every time. This action saves you time and ensures that the variable names match. The imported variable doesn't inherit just the variable name, but also supported variable properties, such as length and default value.
-
Manually define variables: When manually defining variables, be extra careful to use the same names as with variables on the label. Manually define the variables that don't exist in the label, but you need them inside the trigger.
Note
An example would be variables, such as LabelName, PrinterName, Quantity and similar variables that you need to remember the label name, printer name, quantity or other meta-values assigned by the filter.
-
Enabling internal variables: Values for internal variables are assigned by Loftware Automation and are available as read-only values. For more information, see section Internal Variables.
Tip
If you enable the assignment area (in Unstructured Text and XML filters) and dynamic structure (in Structured Text filter), Loftware Automation extracts name:value pairs from the trigger data and automatically sends values to the variables of the same name that are defined in the label. No manual variable mapping is necessary.
Properties
-
Name: Specifies the unique variable name. Names are not case sensitive. Although you can use spaces in variable names, it's a better practice not to. Even more so if you use variables in scripts or in conditions on actions, because you will have to enclose them in square brackets.
-
Allowed characters: Specifies the list of characters a value can occupy. You can select between All (all characters are accepted), Numeric (only digits are accepted), and Binary (all characters and control codes are accepted).
-
Limit variable length: Specifies the maximum number of characters a variable can occupy.
-
Fixed length: Specifies that a value must occupy exactly as many characters as defined by its length.
Note
It is necessary to limit variable length for certain label objects. An example is EAN-13 barcode, which accepts 13 digits.
-
Value required: Specifies that the variable must contain a value.
-
Default value: Specifies a default value. If the variable does not have any value assigned to it, the default value is always used.