Skip to end of metadata
Go to start of metadata

Description

A customer, dropping a CSV file to print a label, would like to suppress the printing of a field based upon a null value. However, the field always prints.

Example

if (Var1 =="")

{label.fields.field.(@name =='Field1').@printingField = false;}

Explanation

The CSV file is being generated by a third party using double quotes to define each field value. Any field that is null, or with nothing in the value, is being sent as "". In Loftware, the scripting engine sees the "" as a single double quote ("), not as a null value. As a result, the field requiring print suppression is ignored and the label still prints.

Solution

Change the script to search for "\"", rather than "" as the null.

Example

if (Var1 =="\"")

{label.fields.field.(@name =='Field1').@printingField = false;}

 

Article Number

2015010 

Versions

All supported LPS family product versions.

Environment

All supported installation environments.