Official translation unavailable. Translate this page with Google:

For Loop

Product level info

Here described product feature is available in NiceLabel LMS Enterprise.

This action executes all of the subordinate (nested) actions multiple times. All nested actions are executed in a loop for as many times as defined by the difference between start value and end value.

UUID-7cda050d-5e85-d9bd-6bf4-1e1b227b0fa3.png

Note

For Loop action starts session printing mode – a printing optimization mode that prints all labels in a loop using a single print job file. For details, see Session Printing section in NiceLabel Automation user guide.

Loop Settings group includes the following options:

  • Start value: loop starting point reference. Select Data source to define the start value dynamically using a variable value. Select or create a variable containing a numeric value for start.

  • End value: ending point reference. Select Data source to define the start value dynamically using a variable value. Select or create a variable containing a numeric value for start.

    Tip

    Negative values are permitted for Start value and End value.

  • Save loop value to a variable: saves the current loop step value in an existing or a newly created variable. The loop step value is allowed to contain any value between start and end value. Save the value in order to reuse it in another action to identify the current iteration.

Use Data Filter

This action executes filter rules on the input data source. As a result, the action extracts fields from input data and maps their values to the linked variables.

Use data filter action executes the selected filter and assigns the variables with respective values.

  • Elements on lower level: The action can create sub-level elements, identified with "for each line" or "for each data block in ...". When you see those, the filter will extract the data not on the document level (with hard-coded field placement), but relatively from the sub areas that contain repeatable sections. In this case make sure that you position your actions below such elements. You have to nest the action under such elements.

  • Mapping variables to fields: The mapping between trigger variables and filter fields is defined either manually, or is automated, dependent on how the filter is configured. If you have manually defined fields in the filter, you also have to manually map fields to the corresponding variable.

    Note

    It's a good practice to define fields using the same names as are names of the label variables. In this case the button Auto map maps matching names automatically.

  • Testing the execution of filter: When the mapping of variables to fields is done, you can test the execution of the filter. The result will be shown on-screen in table. Number of lines in the table represent the number times actions will execute in the selected level. The column names represent the variable names. The cells contain values as assigned to the respective variable by the filter. The default preview file name is inherited from the filter definition, you can execute filter on any other file.

  • Collect records for reports collects your data so you use data filters to create reports. For more information Automating Reports.

UUID-b7bbe427-83b0-a3d5-5620-bf5ad1e21251.png

Navigating your data filter interface.

  1. Filter selection.

  2. Data your filter uses to execute rules.

  3. Report records collection.

  4. Mapping your fields (from filter) to variables (from label/trigger).

  5. Filter execution preview.

For more information, see sections Understanding Filters and section Examples in NiceLabel Automation user guide.

Filter group allows you to select which filter should be used.

  • Name: specifies the name of the filter you want to apply. It can either be hard-coded or dynamically defined using an existing or a newly created variable. The list contains all filters defined in the current configuration. You can use the bottom three items in the list to create a new filter.

Note

Selecting another filter removes all actions which are nested under this action. If you want to keep the currently defined actions, move them outside of the Use Data Filter action. If actions are accidentally lost, Undo your action and revert to the previous configuration.

Data Source group allows you to define the contents you want to send to the printer.

  • Use data received by the trigger: selects the trigger-received data to be used in a filter. In this case, the action uses the original data received by the trigger and execute the filter rules upon it.

    Example 59. Example

    If you use a file trigger, the data represents content of the monitored file. If you use a database trigger, the data is a data set returned from the database. If you use a TCP/IP trigger, the data is raw content received via socket.


  • File name: defines path and file name of the file which contains the data upon which the filter rules will be executed. The content of the specified file is used in a filter. The option Data source enables the variable file name. You must select or create a variable that contains the path and/or file name.

  • Custom: defines custom content to be parsed by the filter. You may use fixed content, mix of fixed and variable content, or variable content alone. To insert variable content, click the button with arrow to the right of data area and insert a variable from the list. For more information, see section Using Compound Values in NiceLabel Automation User Guide.

Data Preview field provides an overview of the filter execution process after the content of the previewed file name is read and the selected filter is applied to it.

The rules in the filter extract fields. The table displays the result of the extraction. Each line in the table represents data for a single label. Each column represents a variable.

To be able to observe result, configure the mapping of fields with matching variables. Depending on the filter definition, you could map the variables to fields manually, or have it done automatically.

  • Preview file name: specifies the file that contains the data that is going to be parsed through the filter. The preview file is copied from the filter definition. If you change the preview file name, the new file name is saved.

  • Open: selects another file upon which you want to execute filter rules.

  • Refresh: re-runs filter rules upon the contents of the preview file name. The Data Preview field gets updated with the result.

For Every Record

This action executes subordinate nested actions multiple times. All of the nested actions are executed in a loop as many times as there are records in the form table with a connected database.

Settings group selects the records.

  • Form table: form table that contains records for which an action should repeat.

  • Use all records: repeats an action for all records in a defined table.

  • Use selected record: repeats an action for the selected records only.

If you use the action Execute SQL Statement with enabled option Iterate for Every Record, NiceLabel automatically inserts For every Record action. A note appears about the automatic mapping of your variables.

UUID-fd1e1d36-7791-3823-5d23-214a3939d49d.png
UUID-3c2cf06d-cd0e-86cb-9e53-23a731f14b58.png

Prompt variables on your label automatically connect to your database fields with the same names. See the instructions on how to create your solutions:

Important

When you create your solution with a database connection, use prompt variables on your labels instead of database fields.

Use the same names for prompt variables as are defined for database fields, for example:

Database field: food_products_1c.ProdCode

Prompt variable on your label: ProdCode

NiceLabel then automatically maps corresponding variables with database fields.

Example 61. Example

Your solution is connected to your database. Your configuration filters requested database records and you want to print filtered records on your labels.

Use action For Every Record and nest actions to print your labels.

UUID-273b54f1-cecc-107f-6081-22d8b96ac772.png