Creating an integration that uses an Excel document as a trigger file Follow
With Revision 5, BarTender 2019 can now use an Excel document as a trigger file in an integration, open it, and use the data contained within it.
This tutorial will walk you through the following:
- Using an excel file as a database
- Setting up a file integration
- Testing and deploying your integration
This tutorial walks you through the basic process of setting up this type of integration. Once you've tried it out, feel free to follow the same steps with your own data.
Creating the label file
- Download database.xlsx to use as your database file.
- Open BarTender Designer and create a new document.
- When you complete the new document wizard, go to File > Database Connection Setup.
- Select "Create a new database connection" and click Next
- Select "Microsoft Excel" from the list and click Next
- Use the Browse button to locate the file, database.xlsx. Select it and click Next
- On this screen, leave everything default. You can take a look at the file preview to see how your database looks with these settings.
- Our data is all contained on Sheet1, the only sheet in the Excel document
- Our first row contains the names of our fields
- Click Next then Finish. Click OK to close the database dialog.
- Now that the database is connected, click on the Data Sources tab in your toolbox if it is not already selected.
- Click and drag both fields onto your label
- Save your label. It is now ready for use!
Creating the Integration
- Open Integration Builder
- From the start screen, select "Create New Integration"
- Select "File" from the dialog and click OK.
- Under File Detection, choose your scan folder location. This is where the Integration will be picking up files.
- Change the file pattern to *.xlsx, since we'll be scanning for Excel files.
- Click on the Print Document action.
- On the Document tab, use the Browse button to navigate to the document you created in the previous section. Like with the scan folder, it's recommended this document be located in a centralized folder and not in My Documents.
- On the Print Options tab, check the box next to "Use data source" and select "File" from the dropdown list.
- In the File Name box, enter "%FilePath%" without the quotes.
- Save your file.
Testing and deploying the Integration
Before we deploy the integration, we'll want to test it and create some sample trigger files. The trigger files must match the same structure as the database linked to the label file. Here's some sample data for testing. This has different data than was in the label's database but the structure is the same:
Please download trigger.xlsx for testing.
- With the integration open, click on the Test tab.
- Click the green Start button on the top ribbon.
- Drop trigger.xlsx into the scan folder you set in the previous section.
- Integration messages will start appearing, confirming that the integration has picked up the file.
- Once you have a successful print, it's time to deploy.
- Click the Deploy tab then the green Deploy button.
- If you have not saved your file, you will be prompted to do so.
- Click the dropdown menu and select "This Computer" from the list. Click next.
- Select "Deploy now" then click Finish.
- Your integration is now deployed.