Skip to main content



Multiple records with web service integration



  • Avatar
    Kris Reddy

    Looking for similar solution

    Trying out the trial, integration is easy with web service, however we can only only send 1 json item and not an array.

    Is there a way bartender can parse json array and print multiple in one web service request?

    For example:

    ,"LatinName":"Product 1'"
    ,"LatinName":"Product 2'"

    Is this possible?

    Please advise,




  • Avatar
    Jasper Wen

    BarTender's Integration Platform currently doesn't support JSON arrays natively out of the box. We already have a feature request submitted in our system.

    At the moment, you can workaround this by using a PowerShell script action to convert a JSON array into a comma separated value format which the Integration Platform and BarTender can interpret. The Powershell script action would be something like this. Of course, you can use Integration variables instead where appropriate.

    1. Have a variable with some JSON data- $jsonArray = '{"PrintJob":[
      {"PrinterName":"TEC-SX4","LabelName":"Test.btw","ProductID":"12546","LatinName":"Product 1","Qty":"2"},
      {"PrinterName":"TEC-SX4","LabelName":"Test.btw","ProductID":"8956","LatinName":"Product 2","Qty":"2"}
    2. Converts the JSON data into Powershell Object- $jsonArray = $jsonArray | ConvertFrom-JSON
    3. Converts the Powershell object and data into a comma separated value format and assigns it to a variable- $outputCSV = $jsonArray.PrintJob | ConvertTo-Csv -NoTypeInformation

    Once you get the data in a CSV format, you then should be able to use the Integration database and print actions such as the transform text to record set, for each database record, and print document action action to print multiple records/labels.

  • Avatar
    Steve Williams

    Currently I am running tests in the 30 day trial version, trying to pass multiple records to the web service request.

    Obviously JSON is fine for passing a single record but I have seen another article in this forum ( ) which suggested that it was possible to pass multiple records using BTXML like this below:

    <?xml version="1.0" encoding="utf-8"?>
    <XMLScript Version="2.0">
    <Command Name="Job1">
    <RecordSet Name="Text File 1" Type="btTextFile">
    "FirstName","LastName","City","Zip Code"

    I have tried this but it doesn't work. I don't get any errors. The messages in my Insomnia REST Client show a WaitStatus of "Completed", Validated = true, "BarTender successfully sent the job etc. etc.". The printer produces a blank sheet of paper.

    It does print the label correctly if I reconfigure the request for JSON, passing a single JSON item.

    Am I missing something? Should I be able to pass multiple records using the BTXML example above?



  • Avatar
    Jason Reibel

    Does anyone have an answer to Steve's question? I would like to implement a similar integration.

  • Avatar
    Jasper Wen

    The BTXML data that Steve Williams has in his previous post looks correct. It could be something that is set incorrectly in the Integration or BarTender document.

    For anybody that is running into issues, feel free to reach out to us at tech support here.

  • Avatar
    Permanently deleted user

    Hi.  It's 4 years later.  We have BT 2019 Enterprise .. is there a way to do multiple labels from JSON now ?

  • Avatar
    Doug Dekker

    Does Bartender 2022 R1 181316 have the ability to process JSON arrays for printing multiple labels from one web service POST?

  • Avatar
    Michael Höller

    Anything new on this topic? I really need this!


Please sign in to leave a comment.