Open Label

Open Label action specifies the label file that is going to be printed. When the action is executed, the label template opens in memory cache. The label remains in the cache for as long as the triggers or events use it.

There is no limit on the number of labels that can be opened concurrently. If the label is already loaded and is requested again, Loftware will first determine if a newer version is available and approved for printing, then open it.

In this example, Loftware loads the label label.nlbl from folder C:\ProjectA\Labels.

C:\ProjectA\Labels\label.nlbl

UUID-85982b89-4df6-ce75-0252-37f1933af2f2.png

If the specified label cannot be found, Loftware tries to find it in alternative locations. For more information, see Search Order for Requested Files.

About group identifies the selected action.

  • Name: allows you to define a custom action name. This makes actions easily recognizable on the solution's list of actions. By default, the action name is taken from its type.
  • Description: custom information about the action. Enter a description to explain the purpose and role of action in a solution.
  • Action type: read-only information about the selected action type.

Using Relative Paths

Loftware supports the use of relative paths for referencing your label file. Root folder is always the folder where the solution (or configuration in case the action is used in a Loftware Automation configuration) is stored.

With the following syntax, the label loads relatively from the location of the configuration file. Automation Builder searches for the label in folder ProjectA, which is two levels above the current folder, and then in folder Labels.

..\..\ProjectA\Labels\label.nlbl

Settings group selects the label file.

  • Label name: specifies the label name. It can be hard-coded, and the same label will print every time. The option Data source enables the file name to be dynamically defined. Select or add a variable that contains the path and/or file name if a trigger is executed or an event takes place.

    Tip

    Usually, the value to the variable is assigned by a filter.

    Note

    Use UNC syntax for network resources.

    Note

    When printing labels usinga solution stored in Control Center's Documents storage, you can use relative path to your label file.

Action Execution and Error Handling

Each action can be set as a conditional action. Conditional actions only run when the defined conditions allow them to be run. To define these conditions, click Show execution and error handling options.

Execution options are:

  • Enabled: specifies if the action is enabled or disabled. Only enabled actions will execute. This functionality may be used while testing a form.
  • Condition: defines one-line programming expression that must provide a Boolean value (true or false). When the result of the expression is true, the action will execute. Condition offers a way to avoid executing actions every time.

Error handling options are:

  • Ignore failure: specifies whether an error should be ignored. If enabled, the execution of actions continues even if the current action fails.

    Note

    Nested actions that depend on the current action do not execute in case of a failure. The execution of actions continues with the next action on the same level as the current action. The error is logged but does not break the execution of the action.

  • Example

    At the end of printing, you might want to send the status update to an external application using the HTTP Request action. If the printing action fails, action processing stops. In order to execute the reporting even after the failed print action, the Print Label action must have the option Ignore failure enabled.

  • Save error to variable: allows you to select or create a variable to save the error to. The same cause of the error is also saved to internal variables ActionLastErrorId and ActionLastErrorDesc.