Get Label Information

Pro_Enterprise.png

This action returns structural information about the associated label file. It provides information about the label dimensions, printer driver and lists all label variables, and their main properties.

The Get Label Information action returns the original information as saved in the label file. Additionally, it also provides information after the print process has been simulated. The simulation ensures that all labels variables get the value as they would have during a normal print. Also, the label height information provides correct dimensions in case you define the label as a variable-height label (in this case, the label size depends on the amount of data to be printed). The action returns the dimensions for a label size, not for a page size.

The action saves label structure information in a selected variable. You can then send the data back to the system using the HTTP Request action (or a similar outbound data connectivity action), or send it back in trigger response, if you use a bidirectional trigger.

UUID-3c296fd4-f620-5bd8-9b6e-cbac77453a14.png

Note

This action must be nested under the Open Label action.

Variable group selects or creates a variable that stores the structural information about a label.

  • Name: specifies the variable name. Select or create a variable which stores the XML-formatted label information.

    • If you want to use the information from the XML inside this trigger, you can define the and execute it with Use Data Filter action (Automation Builder only).

    • If you want to return the XML data as a response in your HTTP or Web Service trigger, use this variable directly in the Response data field of the trigger configuration page.

    • If you want to save the XML data to a file, use the Save Data to File action.

Additional settings group allows you to enable the use of provisional values.

  • Use provisional values: replaces missing data source values with provisional values.

Tip

See section Variable in NiceLabel 10 Designer user guide for detailed description of provisional values.

Sample Label Information XML

The sample below presents a structural view of the label elements and their attributes as they are returned.

<?xml version="1.0" encoding="UTF-8"?>
<Label>
    <Original>
        <Width>25000</Width>
        <Height>179670</Height>
        <PrinterName>QLS 3001 Xe</Printer>
    </Original>
    <Current>
        <Width>25000</Width>
        <Height>15120</Height>
        <PrinterName>QLS 3001 Xe</Printer>
    </Current>
    <Variables>
        <Variable>
            <Name>barcode</Name>
            <Description></Description>
            <DefaultValue></DefaultValue>
            <Format>All</Format>
            <CurrentValue></CurrentValue>
            <IncrementType>None</IncrementType>
            <IncrementStep>0</IncrementStep>
            <IncrementCount>0</IncrementCount>
            <Length>100</Length>
        </Variable>
    </Variables>
</Format>

Label Information XML Specification

This section contains a description of the XML file structure as returned by the Get Label Information action.

Note

All measurement values are expressed in the 1/1000 mm units. For example width of 25000 is 25 mm.

  • <Label>: this is a root element.

  • <Original>: specifies label dimensions and printer name as stored in the label file.

    • Width: this element contains the original label width.

    • Height: this element contains the original label height.

    • PrinterName: this element contains the printer name for which the label has been created for.

  • Current: specifies label dimensions and printer name after the simulated print has been completed.

    • Width: this element contains the actual label width.

    • Height: this element contains the actual label height. If a label is defined as a variable-height label, it can increase along with label objects. For example, Text Box and RTF object sizes may increase in vertical direction and cause the label to expand as well.

    • PrinterName: this element contains printer name that will be used for printing.

      Example 75. Example

      A printer different from the original one is going to be used if the original printer driver is not installed on this computer, or if the printer has been changed using the Set Printer action.


  • <Variables> and <Variable>: the element Variables contains a list of all prompt label variables, each defined in a separate Variable element. The prompt variables are the ones listed in the print dialog box when you print label from NiceLabel 10 . If there are no prompt variables defined in the label, the element Variables is empty.

    • Name: contains variable name.

    • Description: contains variable description.

    • DefaultValue: contains default value as defined for the variable during the label design process.

    • Format: contains the acceptable type of variable content (characters).

    • IsPrompted: contains information whether or not the variable is prompted at print time or not.

    • PromptText: contains text that prompts the user for value input.

    • CurrentValue: contains the actual value that is used for printing.

    • IncrementType: contains information, if the variable is defined as a counter or not. If identified as a counter, it tells what kind of counter it is.

    • IncrementStep: contains information about the counter step. Counter value increments/decrements for this value on the next label.

    • IncrementCount: contains information about the point of counter value incrementing/decrementing. Usually, the counter changes value on every label, but that can be changed.

    • Length: contains maximum number of stored characters in a variable.

    • IsPickListEnabled: contains information whether or not the user selects variable values from a pick list.

    • iPickListValues: contains the actual (selectable) pick list values.

XML Schema Definition (XSD) for Label Specification XML

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Format" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Label">
        <xs:complexType>
            <xs:all>
                <xs:element name="Original">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Width" type="xs:decimal" minOccurs="1" />
                            <xs:element name="Height" type="xs:decimal" minOccurs="1" />
                            <xs:element name="PrinterName" type="xs:string" minOccurs="1" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Current">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Width" type="xs:decimal" minOccurs="1" />
                            <xs:element name="Height" type="xs:decimal" minOccurs="1" />
                            <xs:element name="PrinterName" type="xs:string" minOccurs="1" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Variables">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Variable" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="Name" type="xs:string" minOccurs="1" />
                                        <xs:element name="Description" type="xs:string" minOccurs="1" />
                                        <xs:element name="DefaultValue" type="xs:string" minOccurs="1" />
                                        <xs:element name="Format" type="xs:string" minOccurs="1" />
                                        <xs:element name="CurrentValue" type="xs:string" minOccurs="1" />
                                        <xs:element name="IncrementType" type="xs:string" minOccurs="1" />
                                        <xs:element name="IncrementStep" type="xs:integer" minOccurs="1" />
                                        <xs:element name="IncrementCount" type="xs:integer" minOccurs="1" />
                                        <xs:element name="Length" type="xs:string" minOccurs="1" />
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

Execute Script

This action enhances the software functionality by using custom VBScript or Python scripts. Use this function if the built-in actions don't meet your data manipulation requirements.

Scripts can include the trigger variables – both internal variables and the variables defined or imported from labels.

Make sure that Windows account under which the service runs has the privileges to execute the commands in the script.

UUID-e36abc17-1182-c0fa-0701-0e264b68bed8.png

Note

The script type is configured per trigger in the trigger properties. All Execute Script actions within a single trigger must be of the same type.

Script editor offers the following features:

  • Insert data source: inserts an existing or newly created variable into the script.

  • Verify: validates the entered script syntax.

  • Script editor: opens the editor which makes scripting easier and more efficient.

Script Editor

NiceLabel 10 provides a script editor which makes your Python or VBScript scripting easier, error-free and time efficient.

UUID-ce54344b-81fa-b9a0-d94e-b1301e6bc27a.png

The selection of scripting languages that should be used in Script editor differs between NiceLabel Designer Pro and Automation Builder:

  • In Designer, double-click on the form design surface to open Form Properties >Additional Settings > Form Scripting Language.

  • In Automation Builder, go to Configuration items > click Edit to open trigger properties >Settings > Other > Scripting.

NiceLabel 10 uses .NET variant of Python named IronPython. It works as a fully compatible implementation of Python scripting language which also supports .NET methods.

Editor Ribbon includes commonly used commands which are distributed over multiple functional groups.

  • Clipboard group offers Cut, Copy, Paste and Delete commands.

  • Undo Redo group allows undoing or repeating script editing actions.

  • File group allows loading and saving scripts in a file.

    • Load from file: loads a script from an external previously saved textual file.

    • Save to file: stores the currently edited script in a textual file.

  • Editing group allows finding and replacing strings in a script.

    • Find: locates the entered string in the script.

    • Replace: replaces string in the script.

  • Insert group: Data Source command inserts existing or newly defined data sources into the script.

  • Script group: Validate script command validates of the entered script's syntax.

Available scripting elements contain all available script items which can be used when building a script. Double-click the element or click the Insert button to insert the element at cursor position into the script.

Element description provides basic information about the inserted script element.

Error list includes the errors which are reported after the Validate script command is run.

Message

Use the Message action to write custom strings (For example, custom warning messages, variable values, and comments). The message action creates custom entries in your Automation Manager log files. Automation log files contain application-generated information, warnings, and error descriptions. Use Message logs to track your message variables during configuration, troubleshooting, and debugging.

To configure Message actions, do the following:

  1. Go to All Actions and select Message from the drop-down Action menu.

  2. Rename your action and insert your description.

  3. Configure your message Content: Caption, Message, and Message Type.

    Message Types include:

    • Information

    • Error

    • Warning

  4. Expand Show execution and error handling options to set conditions for showing messages, ignoring failures, and saving Automation errors to variables.

NiceLabel Automation Manager displays colored Messages (For example, red errors and orange warnings) in your Automation Log pane.

Example 78. Example:

You print Pasta labels with Automation. Your trigger receives variable values from ERP generated CSV files. When your variable "Package" value is greater than 4, Automaton Log creates a warning.

UUID-b60ba704-43c4-1d2f-b8d0-36d2f43a8c43.png

Configuring Message actions.

Your result in Automation Manager looks like this:

UUID-0fd41f2d-25c1-6051-b2d2-86c5f744ceff.png

Note

When you set your Message severity to Error, your triggers do not go to error state. Printing is still possible.

Use Message logs for:

  • configuration troubleshooting

  • debugging your solutions

  • tracking values of your selected variables

displaying your customized warnings and error messages

Verify License

This action reads the activated license and executes the actions nested below this action only if a certain license type is used.

Tip

Verify License action provides protection of your trigger configuration from being run on unauthorized machines.

Note

License key that activates software can also encode the Solution ID. This is the unique number that identifies the solution provider that sold the NiceLabel 10 license.

If the configured Solution ID matches the Solution ID encoded in the license, the target machine is permitted to run nested actions, effectively limiting execution to licenses sold by the solution provider.

The triggers can be further encrypted and locked so only authorized users are allowed to open the configuration. For more information, see section Protecting Trigger Configuration in NiceLabel Automation user guide.

License Information group allows you to select the license ID.

  • License ID: defines the ID number of the licenses that are allowed to run the nested actions.

    • If the entered value is not the License ID that is encoded in the license, the nested actions is not executed.

    • If the entered value is set to 0, the actions execute if a valid license is found.

Note

Digital Partner UID can also be used as License ID. This option is available for members of NiceLabel Digital Partner Program.

Try

Enterprise.png

This action allows you to:

  • Monitor errors while the actions are being executed.

  • Run an alternative set of actions if an error occurs.

Try action creates Do and On error placeholders for actions. All actions that should execute if a trigger fires, must be placed inside the Do placeholder. If no error is detected when executing actions from Do placeholder, these are the only actions that ever execute. However, if an error does happen, the execution of actions from Do placeholder stops and the execution switches over to actions from On error placeholder.

Note

You must enable Synchronous Printing to catch errors with On error.

UUID-3cce3b0f-703f-8112-8657-b94a17ee1a7c.png

Example 81. Example

If any action in the Do placeholder fails, the action execution stops and resumes with the actions in the On Error placeholder. If Try would be placed on its own, that would terminate the trigger execution. In our case, Try is nested under the For loop action. Normally, any error in Do placeholder would also stop executing the For loop action, even if there are still further steps until the For loop is complete. In this case, the Save Data to File action does not execute as well. By default, each error breaks the entire trigger processing.

However, you can also continue with the execution of the next iteration in the For loop action. To make this happen, enable the Ignore failure option in the Try action. If the data from the current step in For Loop causes an error in the Do placeholder, the actions from On Error execute. After that, the Save Data to File in level 2 execute and then the For loop action continues to execute in the next iteration.


Tip

This action provides for an easy error detection and execution of "feedback" or "reporting" actions. For example, if an error happens during trigger processing, you can send out a warning. For more information, see section Print Job Status Feedback in NiceLabel Automation user guide.

Note

Important! The Try action gives expected results with asynchronous actions. If your Try loop includes the Print Label action that fails, the action execution still completes the Try loop, and does not switch to the On error actions as expected. The result for not switching to the On error actions is the Print Label action that runs in synchronous mode by default. To avoid this, make sure supervised printing is on. Go to trigger settings > Other > Feedback from the Print Engine and enable Supervised printing.

Read more about supervised printing in section Synchronous Print Mode.

XML Transform

Enterprise.png

This action transforms an XML document into another document using the provided transformation rules. The rules must be provided by a .XSLT definition in a file, or by another variable source.

The action allows you to convert complex XML documents into XML documents with a more manageable structure. XSLT stands for XSL Transformations. XSL stands for Extensible Stylesheet Language, and works as a stylesheet language for XML documents.

XML Transform action stores the converted XML document in the selected variable. The original file is left intact on the disk. If you want to save the converted XML document, use action Save Data to File.

Note

Typically, you would use the action to simplify XML documents provided by the host application. Defining XML filter for the complex XML document might take a while, or in some cases the XML is just too complex to be handled. As alternative, you would define the rules to convert XML into structure that can be easily handled by the XML filter, or even skipping the need for a filter altogether. You can convert XML document into natively-supported XML, such as Oracle XML and then simply executing it using the Run Oracle XML Command File action.

Data Source group defines the XML data to be transformed.

  • Use data received by the trigger: defines that the trigger-received data it used. The same result can be achieved by enabling the internal variable DataFileName and using the contents of file it refers to. For more information, see section Using Compound Values in NiceLabel Automation user guide.

  • File name: defines the path and file name of the file containing the XML file to be transformed. Contents of the specified file is used. Data source enables the file name to be defined dynamically. Select or create a variable that contains the path and/or file name. The action opens the specified file and applies transformation on file contents, which must be XML- formatted.

  • Variable: selects or creates the variable that contains printer stream. The contents of selected variable is used and it must contain XML structure.

Transformation Rules Data Source (XSLT) group defines the transformation rules (.XSLT document) that are going to be applied to the XML document.

  • File name: defines path and file name of the file containing the transformation rules (.XSLT).

  • Custom: defines custom contents. You can use fixed content, mix of fixed and variable content, or variable content alone. To insert a variable content, click the button with arrow to the right of data area and insert variable from the list. For more information, see section Using Compound Values in NiceLabel Automation user guide.

Save Result to Variable group defines the variable to store the transformed file.

  • Variable: selects or creates a variable that is going to contain the result of the transformation process. E.g. if you use the rules that convert complex XML into simpler XML, the content of the selected variable is a simple XML file.

Group

This action configures multiple actions within the same container. All actions placed below the Group action belong to the same group and are going to be executed together.

This action provides the following benefits:

  • Better organization and displaying of action workflow. You can expand or collapse the Group action and display the nested actions only when needed. This helps keep the configuration area cleaner.

  • Defining conditional execution. You can define a condition in the Group action just once, not individually for each action. If the condition is met, all actions inside the Group are executed. This can save a lot of configuration time and can reduce the number of configuration errors. Group action provides a good method to define IF..THEN execution rules for multiple actions.

Log Event

This action logs an event to NiceLabel Control Center for history and troubleshooting purposes.

Note

To make Log event action active, make sure that print job logging to NiceLabel Control Center is enabled.

Event Data group provides information about the logged event.

  • Information: basic description of the event that will be included in the NiceLabel Control Center event log. Up to 255 characters are allowed in this area.

  • Details: detailed description of the event to be logged in the NiceLabel Control Center. Up to 2000 characters are allowed in this area.

Tip

The descriptions entered in Information and Details fields allows you to filter out the events in Control Center All Activities History. When working with Control Center, go to History > All Activities > Define filter. For more details, read the Control Center User Guide.

Preview Label

Enterprise.png

This action executes the print process and provides label image preview. By default, the preview is saved to disk as JPEG image, but you can choose other image format. You can also control the size of the created preview image. The action generates preview for a single label.

Once you have the label preview created in a file, you can send the file to a third party application using one of the outbound actions, such as Send Data to HTTP, Send Data to Serial Port, Send Data to TCP/IP Port, or use it as response message from bidirectional triggers, such as and Web Service Trigger. The third party application can take the image and show is as label preview to the user.

Preview group defines the file to be previewed and its details.

  • File name: specifies the path and file name. If hard-coded, the same file is used every time. If you only use the file name without path, the folder with configuration file (.MISX) is used. You can use a relative reference to the file name, where folder with .MISX file is used as root folder. Data source option enables variable file name. Select or create a variable that contains the path and/or file name after a trigger is executed. Usually, the value to the variable is assigned by a filter.

  • Image type: specifies the image type which is used for saving the label preview.

  • Preview label back side (2-sided labels): enables preview of the back label. This is useful, if you use double-sided labels and want to preview the label's back side.

Example 86. Example

For example, if your label template defines dimension as 4" × 3" and the label printer resolution is set to 200 DPI, the resulting preview image has dimensions of 800 × 600 pixels. Width equals 4 inches times 200 DPI, which results in 800 pixels. Height equals 3 inches times 200 DPI, which results in 600 pixels.


Additional settings group allows you to enable the use of provisional values.

  • Use provisional values: replaces missing data source values with provisional values and displays them in the label preview.

    Tip

    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.

Create Label Variant

Enterprise.png

This action allows you to create a review-ready variant of an existing label. Label objects in such variants have locked data source values. Their content is defined by the current value of the applicable data source.

The purpose of creating a review-ready variant of a label with “locked” data sources is to make the label suitable for approval process in which data and template need to be approved together. Instead of viewing a label without defined content for its objects, the approver reviews a variant with defined values. This allows him to quickly see and approve the final label layout with actual values that are going to be used for printing.

Tip

Label approval process is applicable to labels that are stored in Control Center Document Storage. You can apply various approval workflow types for the stored labels and label variants. Approval workflow selection depends on the requirements of your business environment. See NiceLabel 10 Control Center User Guide for more details.

Settings group defines the label file to be converted and the output file (label variant).

  • Label name: the name of the label file to be converted into a review-ready variant with locked data source values. Data source dynamically defines the Label name using an existing or newly created variable.

  • Print time data sources: this option allows you to define the data sources whose values are going to be provided at the actual print time. If a data source is listed in this field, its value is not locked and can be provided at print time. Typical examples are data sources for production values like LOT number, expiry date, etc.

    Tip

    Insert only data source names without square brackets, separated by commas or listed in a column using Enter key.

  • Output file name: the name of the label variant file that is going to be ready for review. Data source dynamically defines the Label name using an existing or newly created variable.

There are several rules that apply to the review-ready label variant:

  1. Data source values are locked by default. To exclude the data sources from being locked, list them in Print time data sources field to keep them active on the review-ready label. You can define their values at print time.

  2. Counter variables, functions, database fields and global variables are converted to non-prompted variables.

  3. Graphics are embedded.

  4. The destination label variant stored in NiceLabel Control Center Document Storage is automatically checked in. Original Label name and Print time data sources are used as check-in comment.

  5. Label variants can be opened in NiceLabel 10 Designer in locked state.

  6. Label files generated with this action cannot be imported.

  7. If label variants are stored in printer memory, the recall command can only provide values for print time data sources.

  8. If using NiceLabel Control Center, label preview in Document Storage allows editing of print time data sources.

  9. Current time and current date variables cannot be set as Print time data sources on the review-ready label variant.