Barcode javascript

We are are setting up a barcode in the output presets and need to write a script. Currently, I do lots of if then else statements to decide what needs to be printed (in PlanetPress 7) . I am very new to Connect. So I was wondering if anybody would be willing to share what they have written for a barcode definition in Connect. How do you define your variables, perform logic and concatenated things together in the Java script editor. Thank you.

Hi Diane,

To have access to variable data in the additional contents portion, you must configure field metadata at the job creation step (see documentation for reference). This will allow you to use your data fields in your expression. In regards to building expressions in the barcode contents section, you can find variables and formatting options here:
https://help.objectiflune.com/en/planetpress-connect-user-guide/2021.1/#designer/Output/Print/Variables_available_in_the_Output.htm
This could be an example of a 3of9 barcode expression for an inserter:
${sheet.nr,00}${document.count.sheets,00}${document.metadata.selectFeed}${document.metadata.jobID}${document.metadata.CONTROL_NO}${if(document.metadata.shiftTray == “1” && sheet.nr == document.count.sheets){
“1”} else {“0”}}

As you can see there could be a lot going on and attacking this without Connect experience can be daunting. I’d advise opening a support ticket if you need further assistance with this.