Variables act as containers for storing and passing data between objects, scripts, external applications, printers, and user inputs. Use variables to print labels where data changes on each label (e.g., counters, serial numbers, date, time, weight, and product images).
To create labels with changing data, use Desktop Designer to easily format your labels using variable data.
Desktop Designer includes multiple types of variables:
-
Variable: changes value at print time or according to conditions you define.
-
Current Date: displays current date as a variable value.
-
Current Time: displays current time as a variable value.
-
Counter: changes value incrementally or decrementally with each label you print.
Tip
Manage all your label and solution variables in Dynamic Data Explorer.
Variable (also known as prompt variable) is a type of variable that obtains its value at print time.
About group of settings identifies the variable and sets its definition.
-
Name: unique variable name. This name is used as the variable reference during its use.
Note
Avoid using non-alphanumerical characters when defining the variable name.
Tip
Enter the name to make the variable easy to find when listed among other variables in the Dynamic Data Explorer.
-
Description: is a field that allows adding additional information and suggestions.
Definition group of settings defines which input data types are valid for a variable.
-
Data type defines what type of data is stored in a variable.
-
Text: variables that contain text.
-
Date: variables that contain date values.
-
Time: variables that contain time values.
-
Floating point: representation of real numbers in a variable.
-
Currency: variables that contain monetary values.
-
-
Initial value: starting value that is assigned to a variable when created. It is defined using one of the following methods:
-
Manually entering a fixed value. Characters from any group of allowed characters are permitted.
Tip
If you enter full stop (".") as the initial value for a variable with selected Date or Time data type, it displays current date or time.
Example 24. Example
Edit field on a form is connected to a variable with Date selected as Data type. If full stop is selected as Initial value, the Edit field displays current date when the form is run. Drop down button opens Date picker with preselected current date.
-
Using a dynamic value. Dynamic data sources from the toolbar are supported – two options are available:
-
Enter the source as Name in square brackets, e.g. [CurrentDate], [Counter].
-
Enter the source as Name in square brackets.
-
Select the dynamic data source from the dropdown list.
-
-
Using a special character:
-
Special character can be entered manually using the less than/greater than signs, e.g. <CR>, <LF> ...
-
Special character can be selected from the dropdown list.
-
Tip
Make sure the inserted initial value meets the criteria defined with Output Rules for each data type.
-
Provisional value defines a custom placeholder variable value in an object while designing labels or forms. In a label object, the provisional value is replaced by the real variable value at print time. In a form object, the real variable value appears when the form is run.
-
Auto generated: generates the provisional value automatically. Disable this option to define and use a custom provisional value.
Tip
By default, provisional value equals the initial value.
If the provisional value (auto generated or custom) is empty or uses an invalid format, it is generated based on the selected variable Data type. Default formats of provisional values are listed below.
-
Six question marks (??????) for Text data type
-
Current date or time for Date data type
-
Current time for Time data type
-
9.999.999,99 for Floating point data type
-
9.999.999,99 € for Currency data type
Note
If the variable Output rules change, the provisional value format adapts accordingly.
Text data type is used for variables that store textual content. As a result, only textual input is allowed as the variable input data type.
Data group defines permitted data properties.
-
Allowed characters: definition of permitted variable input characters.
Tip
Groups of allowed characters for data input filtering are described in section Groups of Allowable Characters.
-
Limit length: maximum length of variable value.
-
Fixed length: variable must contain the exact number of characters as defined in the Limit length.
Check range group allows you to enter the minimum and maximum permitted value of the variable. Setting the limits is optional.
-
Minimum value: the lowest permitted variable value.
-
Maximum value: the highest permitted variable value.
Note
If enabled, minimum and maximum values must not be left empty.
Pick list group predefines a list of selectable input values for a variable. No other values can be used with this variable if a pick list is defined.
Selection of pick list values for a label object is done on the printing form. The user selects one of the available values and prints the label. If a pick list is used for a form object, it acts as an Edit Field object – when the form is run, the user selects from the predefined values.
-
Enable pick list: enable this option to set a limited range of selectable values.
-
Pick list values: enter the selectable values. Separate individual values by placing them in lines.
Date data type stores date-related values in the selected variable. Date field displays the date value using various date formats. The date value format can be either selected from the preloaded formats, or customized to meet the specific local, regulatory, or industry-related requirements.
Input Formatting group defines the allowed date format and displays a preview.
-
Input format: allowed date input format.
-
Sample value: displays the preview according to the selected input format.
Note
Desktop Designer supports a range of preloaded or customized date formats.
Check range group allows you to enter the minimum and maximum permitted value of the variable. Setting the limits is optional.
-
Minimum value: the lowest permitted variable value.
-
Maximum value: the highest permitted variable value.
Note
If enabled, minimum and maximum values must not be left empty.
Output formatting sets the output date format.
-
Output format: format in which the date is displayed.
-
Output language: language selection and regional formatting for days and months.
Output Language becomes relevant when the dates that include months or dates are written in words. In some cases, data calculations may be affected as well. For example, in the US, a new week begins on Sunday whereas, in the EU and other countries, a new week begins on Monday.
-
Sample value: date preview according to the selected input format.
Prefix and Suffix group defines characters that are added to a variable value.
-
Prefix: text placed in front of the variable value.
-
Suffix: text placed behind the variable value.
Multiline: divides your text into multiple lines.
Warning
Avoid using this setting if possible. The recommended alternative for presenting multiline text on a label or form is to use the Text Box object.
-
Number of lines: maximum number of lines for a variable value.
-
Line length: maximum number of characters in a single line.
-
Word wrap: divides the text into multiple lines at space character locations.
Time data type stores time values in a variable. Time field displays the date value using various time formats. The time value format can be either selected from the preloaded formats, or customized to meet the specific local, regulatory or industry related requirements.
Input Formatting defines the allowed time format and displays a preview.
-
Input format: allowed time input format.
-
Sample value: variable preview according to the selected input format.
Note
Desktop Designer supports a range of preloaded or customized time formats.
Check range group allows you to enter minimum and maximum permitted value of the variable. Setting the limits is optional.
-
Minimum value: the lowest permitted variable value.
-
Maximum value: the highest permitted variable value.
Note
If enabled, minimum and maximum values must not be left empty.
Output formatting defines the output time format.
-
Output format: format in which the time is displayed.
-
Sample value: time preview according to the selected input format.
Prefix and Suffix group defines characters that are added to a variable value.
-
Prefix: text placed in front of the variable value.
-
Suffix: text placed behind the variable value.
Multiline group divides text into multiple lines.
Warning
Avoid using this setting if possible. The recommended alternative for presenting multiline text on a label or form is to use the Text Box object.
-
Number of lines: maximum number of lines for a variable value.
-
Line length: maximum number of characters in a single line.
-
Word wrap: divides the text into multiple lines at space character locations.
Floating Point data type specifies the representation settings for numeric values that are stored in a variable. This Data type is used to set the digit grouping points (separators) according to the regional specifics, and to place the decimal delimiters at the right places.
Input formatting specifies the allowed input number format.
-
Decimal delimiter: specifies the character that separates the integer part from the fractional part of a number written in decimal form.
-
Decimal places: the number of decimal places to be included in the number.
-
Use 1000 separator: separator places the thousands into groups.
-
Separator: a character that is used as thousands separator.
-
-
Sample value: displays a preview of the current number input format.
-
Limit variable length: enables limiting the number of digits to be defined for a variable.
-
Length (characters): allowed number digits in a variable.
-
Check range defines the minimum and maximum number values. Defining the minimum and maximum limits is optional:
-
Minimum value: the lowest allowed input number.
Note
If already defined, the initial value is taken as the minimum value.
-
Maximum value: defines the highest allowed input number.
Output formatting group specifies the preferred output number format.
-
Decimal delimiter: the character that separates the integer part from the fractional part of a number written in decimal form.
-
Decimal places: the number of decimal places to be included in the number.
-
Auto: decimal places are defined by local system settings.
-
-
Use 1000 separator: enabled use of a separator that places the thousands into groups.
-
Separator: a character that is used as thousands separator.
-
Sample value displays a preview of the current output format.
-
Currency data type is used for variables that store numerical values of monetary amounts. Define currencies for various regions and set their properties.
Initial value for Currency Data type is defined using one of the following methods:
-
Manually entered fixed value. The number is delimited according to the Input formatting settings.
-
Use of a dynamic value. Dynamic data sources from the toolbar are supported – two options are available:
-
The source is entered Name in square brackets, e.g. [Variable_1].
-
Dynamic data source selection from the dropdown list.
-
-
Use of a special character:
-
Special character can be entered manually using the less than/greater than signs, e.g. <CR>, <LF> ...
-
Special character can be selected from the dropdown list.
-
-
Input formatting group specifies the allowed input currency format.
-
Decimal delimiter is the character that separates the integer part from the fractional part of value written in decimal form.
-
Decimal places is the number of decimal places that is allowed to be included in the value.
-
Use 1000 separator enables using a separator that places the thousands into groups.
-
Separator: character that is used as 1000 separator.
-
-
Currency symbol is a graphic symbol that represents a currency.
-
Placement: position of the currency symbol.
-
-
Sample value displays a preview of the currency input format.
-
Limit length enables limiting the number of digits to be defined in a variable.
-
Length (characters): allowed number of digits in a variable.
-
Check range defines the minimum and maximum values expressed in currency. Defining the minimum and maximum limits is optional.
-
Minimum value: the lowest allowed input currency value.
Note
If already defined, the initial value is taken as the minimum value.
-
Maximum value: the highest allowed input currency value.
Output formatting specifies the preferred output currency format.
-
Decimal delimiter: character that separates the integer part from the fractional part of a value written in decimal form.
-
Decimal places: number of decimal places to be included in the value.
-
Use 1000 separator: separator that places the thousands into groups.
-
Separator: character that is used as 1000 separator.
-
-
Currency symbol is a graphic symbol that represents a currency.
-
Placement defines the currency symbol's position. Select it from the dropdown list.
-
Sample value displays a preview of the currency input format.
Current Date is a type of variable that displays the current date value. The value is obtained from the system or printer clock.
About group identifies the variable and defines date output format and language.
-
Name: unique variable name.
-
Description: is a field that allows adding additional information and suggestions.
Definition group sets output formatting and displays its preview.
-
Output format: format in which the date is displayed. Available date formats are listed here.
Note
The selected clock source option (see below) defines the range of allowed date Formats. Printer clock option only allows the use of printer supported date formats. An error returns if a non-valid format is used. Computer (system) clock option allows a range of preloaded or customized date formats.
-
Output language: language selection and regional formatting for days and months.
Example 29. Example
Output Language becomes relevant when the dates that include months or dates are written in words. In some cases, data calculations may be affected as well. For example, in US, a new week begins on Sunday whereas in EU a new week begins on Monday.
-
Output preview: displays the printed current date. The range of used characters adapts to the selected Output language and printer.
Date offset group enables adding a certain number of days, months or years to the current date. The offset date is displayed in the object instead of the present date.
-
Days: date offset in days.
-
Months: date offset in months.
-
Years: date offset in years.
Tip
To set negative date offset, use the Date Offset function.
Printer Clock group defines which clock should be used as the date value source.
-
Always use computer clock: computer (system) clock set as the exclusive Current Date value source.
-
Always use printer clock: printer clock set as the exclusive Current Date value source. An error is returned if the printer clock is unavailable.
-
Use printer clock if supported: printer clock set as the preferred Current Date value source. If the printer clock is not supported, the computer (system) clock value is used instead.
Prefix and Suffix values may be added to a variable value if required.
-
Prefix: text placed in front of the variable value.
-
Suffix: text placed behind the variable value.
Desktop Designer enables flexible use of date fields. When defining the formats, the following notations are used:
Notation |
Description |
d |
The number of the day in a month. Occupies one or two characters. |
dd |
The number of the day in a month. Always occupies two characters – leading zeros are added if necessary. |
M |
M is the number of month. Occupies one or two characters. |
MM |
MM is the number of month. Always occupies two characters. |
yy or yyyy |
The year represented with 2 or 4 digit numbers. |
ddd |
The abbreviated name of the day of the week. |
dddd |
The full name of the day of the week. |
MMM |
The abbreviated name of the month. |
MMMM |
The full name of the month. |
J |
The number of days since January 1. Occupies from one to three characters. |
JJJ |
The number of days since January 1. Always occupies three characters. |
W |
The week number in current year. Occupies one or two characters. |
WW |
The week number in current year. Always occupies two characters. |
N |
The weekday number. The value range takes 1–7 characters, where 1 represents Monday and 7 represents Sunday. |
Custom text |
Any sequence of characters is displayed unchanged. Insert dots, commas, and other characters to present the date as required. |
Current Time is a type of variable that displays the current time value. The value is obtained from system or printer clock.
About group of settings identifies the variable and defines time output format and language.
-
Name: unique variable name. This name is used as a variable reference during its use.
-
Description: is a field that allows adding additional information and suggestions.
Definition group sets output formatting and displays its preview.
-
Output format: format in which the time is displayed. Available time formats are listed here.
Note
The selected clock source option defines the range of supported time Formats. Printer clock option only allows the use of printer supported time formats. An error returns if a non-valid format is used. Computer (system) clock option allows a range of preloaded and customized time formats.
-
Output preview displays the printed current time format.
Time offset enables adding or subtracting a certain number of seconds, minutes or hours from the current time.
-
Seconds: time offset in seconds.
-
Minutes: time offset in minutes.
-
Hours: time offset in hours.
Printer Clock group defines which clock should be used as the time value source.
-
Use printer clock if supported: printer clock set as the preferred current time value source. If the printer clock is not supported, the system clock value is used instead.
-
Always use printer clock: printer clock set as the exclusive Current Time value source. An errorreturns if the printer clock is unavailable.
-
Always use computer clock computer (system) clock set as the exclusive Current Time value source.
Prefix and Suffix values may be added to a variable value if required.
-
Prefix: text placed in front of the variable value.
-
Suffix: text placed behind the variable value.
Desktop Designer enables flexible use of time fields. Select a predefined time format or create a customized one. When defining the formats, the following notations are used.
Notation |
Description |
h |
Hours in 12-hour format. AM/PM is added, if selected. Occupies one or two characters. |
hh |
Hours in 12-hour format. AM/PM is added if selected. Always occupies two characters. Leading zeros are added, if necessary. |
H |
Hours in 24-hour format. Occupies one or two characters. |
HH |
Hours in 24-hour format. Always occupies two characters. |
mm |
Used for minutes. |
ss |
Used for seconds. |
Counter is a type of variable whose value increments or decrements along with the changing value of system or printer counter.
Thermal printers are usually equipped with an internal incremental counter. This is a dedicated counter that counts the printed labels internally. The printer only receives the first value and automatically increases or decreases it on the subsequent labels. This option reduces the amount of data transferred between your computer and printer as only initial value is sent to the printer. Internal counter speeds up the label production significantly.
About group of settings identifies the variable and defines serialization details.
-
Name: unique variable name. This name is used as variable reference.
-
Description: is a field that allows adding additional information and suggestions.
Definition group of settings defines the counter behavior.
-
Counter type: counter value increasing or decreasing.
-
Incremental: value increases along with the printed labels.
-
Decremental: variable value decreases along with the printed labels.
-
-
Step: amount of units that represent the next state of counter value.
-
Repetition: number of repetitions for each counter value.
-
Initial value: value that is used when the counter starts.
-
Preview: displays the counter value sequence.
Example 30. Example
Counter Step = 3, Repetition = 3 and Initial value = 1 are: 1, 1, 1, 4, 4, 4, 7, 7, 7, 10, 10, 10, 13, 13, 13, ...
Prompting group of settings defines the print time behavior of a data source. Read more about prompting here.
Printer Counter defines which counter should be used as a counter variable value source.
-
Use printer counter if supported: printer counter is set as the counter of choice if supported by the active printer. If the printer counter is not supported, system counter is used instead.
-
Always use printer counter: printer counter set as the exclusive counter value source. If the printer counter value is not available, the default (system counter) value is used.
Note
An error is reported if the selected printer has no support for internal printer counter. Printing cannot continue.
-
Always use computer counter: computer counter set as the only counter value source.
To use internal printer counter, follow these rules:
-
The variable's maximum length is limited by the printer. The value should be included in the printer user guide.
Tip
If the exact maximum variable length value is not available, NiceLabel recommends making a few test prints for determining the value.
-
Set variable length to fixed.
-
Set variable format to numeric.
-
Text object that is linked to the variable must be formatted using an internal printer font.
-
Enable Always use printer counter option.
-
Ensure the Internal Element icon is visible next to the counter text.
-
Ensure an internal printer font is used for the counter text.
Data defines the counter input criteria.
-
Allowed characters: permitted characters for variable values. Groups of allowed characters for data input filtering are described in section Groups of Allowed Characters.
Example 32. Example
Non-numeric characters can also be used as counter values. Alphanumeric sets the sequence with Step = 3 and Initial value = 1 as 1, 4, 7, A, D, G, J, M, P, S, V, Y, b, e, h, ...
-
Limit length: maximum length of a variable value.
-
Length (characters): specifies the exact number of characters permitted.
-
-
Fixed length: variable must contain the exact number of characters as defined in the Limit variable length.
Check range group defines minimum and maximum counter values.
-
Minimum value: minimum counter value.
-
Maximum value: maximum counter value.
Rollover settings group defines the condition at which the counter automatically resets its value to default.
-
Using min/max: minimum and maximum counter values activates the rollover.
-
When the selected data source changes: data source value change activate the rollover.
-
When date or time changes: date or time value change activates the rollover.
Note
Date/time change is defined by computer clock.
When designing labels with connected dynamic data sources, a value has to be assigned to them before printing. Prompted variables have their values manually assigned at print time. The user is asked for the value of every variable before each print job.
The values are entered manually. The order in which they are entered may be specified using the Prompt order dialog.
Prompting group asks the user for manual data input – this is done after the print dialog opens.
-
Prompt at print time: enabled or disabled prompting form variable value.
Note
If a dynamic data source is included in the Initial value, prompting becomes disabled.
-
Prompt text: contains text that prompts the user for value input. This text serves as instruction on what kind of values should be entered before printing.
-
Value required: variable value status – mandatory or optional. If the prompt text is left empty if the value is set as mandatory, printing cannot start. An error message appears.
Printing form variables are automatically generated variables that store user-defined values of default printing form objects when the printing form is run.
Printing form variables are added to a solution in two cases:
-
when adding a new printing form (go to Home tab > Customize Print > Add new form > Printing form).
-
when editing a printing form (go to Home tab > Customize Print > Edit printing form).
Details about these two operations are described here.
These variables are listed among other connected data sources (named PrintingForm_[VariableName]). They are all listed in the Dynamic data explorer and therefore become editable in Dynamic data manager.
All printing form variables belong to the prompted variable type. They can all be edited – renamed and configured with customized data types, and Input/Output rules.
Note
To remain in line with best-practice recommendations, NiceLabel suggests you to avoid editing the printing form variables. If you find editing necessary, double check that the customized data type and Input/Output rules do not interfere with label printing.
Note
If an issue occurs while using a customized printing form, Recreate Printing Form option allows you to restore the default printing form. All changes are discarded in this case.
What differs the printing form variables from "normal" user created variables is that they are:
-
reused by all other printing forms in a solution.
-
after being deleted, they are recreated for any newly added printing form in a solution.
Desktop Designer printing form variables include the following:
-
PrintingForm_IdenticalCopies: stores the quantity of identical labels copies to be printed.
-
PrintingForm_LabelName: stores the name of the selected label. This variable tells the printing form which label in the solution is printed.
-
PrintingForm_LabelSets: stores the quantity of print jobs to be sent to the printer.
-
PrintingForm_PrinterName: stores the name of the selected printer.
-
PrintingForm_PrintToFile: stores the name of the file to which the label is printed.
-
PrintingForm_Quantity: stores the quantity of printed labels.
-
PrintingForm_SkippedLabels: stores the quantity of skipped labels.
Note
Although the objects on the printing form can be connected to any type of user defined data sources, NiceLabel recommends you to leave the objects connected to automatically generated printing form variables.