How to use len function for object value data type? Follow

Michael Capinjola

Hello, I'm trying to script a field that will change a date format string based on its length in order to consolidate some labels we have.

I'm using a barcode with 4 values with comma separation, I was trying to use an object value pointed at the full barcode and using transforms to delete all the info that it didn't need so I would be left with the date string. Then I wanted to use the len function on the value to check for 6 digits or 8.

My hangup is, I can't seem to pull the value of the data source when it's an object value, and I'm not sure if I can convert/move it to a different data source type like embedded that I can give a reference to that will allow me to do the len function after it runs through the transforms.

Is this possible or do I need to rethink how I'm pulling the string from the barcode? Thank you.


Shotaro Ito
Comment actions Permalink

Hi Michael,

If you want to get length of barcode "Barcode 1",

In VB Script data source, Multi line script,

Value = LEN(Format.Objects("Barcode 1").Value)

Besides, when you have BarTender 10.0 or later, you can apply Search and Replace transform to Object Value data source.

You can use regular expression to have flexible replace in Search and Replace.

Please sign in to leave a comment.