Barcoding Decimal Values

I am trying to create license plate labels and one of the elements I need to add is Work qty in a barcode. When print previewing my label, I get an error message that says:

# Description
1 Barcode element binding for property Value failed: Value binding ‘{Source: System.Xml.XmlNode; Path: WHSLicensePlateLabel/@Qty}’ results in a value of type ‘System.Decimal’. Only strings or numbers are allowed.

And the barcode is missing from my label.

I can’t control the format of the data that comes from D365, so is there a way to transform that data into a number/string and then barcode that data?

Hi Edina and welcome to Docentric Community Forum :slight_smile: ;

To answer your question: Yes, you can change the types of data.

For conversion of string data into a number you use the number(numstring) function, where numstring represents a string value which can be cast into a number.

For conversion of number into string, you can use the string(somenumber) function,
where somenumber represents a number value which will be converted into string. For dates and numbers you can also us the format(source, formatstring, culture). A field MyField with a number value 1234.00000000 would be converted like this: format(@MyField, ‘n2’, ‘en-US’) and that would return a string with the value 1,234.00.

One important think to know is that you can only convert a single value (one record). If you have a collection of records, you first need to process them in a List tagging element and then you can convert fields from the individual records.

1 Like