How to create a basic CSV integration using database overrides
Overview
CSV integrations are one of the simplest and most useful integrations. They require only a little bit of setup to get started. This type of integration uses the information from a trigger file to override the database attached to a label. Make sure to use the version dropdown at the top as UI may be different between BarTender versions.
If you are looking for similar integrations, see these other helpful tutorials:
- Print Document Using Print Command Script (Video - 9:40) - an Integration which sets the printer and label information in the script header and contains a CSV database
- How to create a CSV integration using Named Data Sources - a CSV integration which breaks apart a CSV and distributes it into Named Data Sources on the label. Can be used to set printer and label information as well.
Applicable to
BarTender 2022 and later
Information
Setting up the label
First, begin by setting up the label file and connecting it to a dabase. You can use your own CSV or save this simple sample database in a text or CSV file:
Name,Food,ID
Seagull Kitty Snax,cat treats,12334668
BarTender Dog Bones,dog food,25346489
- Create a new label and connect to the text database. If you're not familiar with the process, check out Getting started with database connections (Video - 5:20).
- In the toolbox (default location is on the left side of the UI), click the Data Sources tab.
- Click and drag a database field from this toolbox and drop it on the label design area. Repeat this for each database field you wish to add to the label.
- Save the label.
Creating the integration
For your integration, you will need a trigger file. The file must match the database format you used with the label. So a CSV trigger must match a CSV database and tab delimited database must have a tab delimited trigger. If you used the example above, here's a sample trigger file to use:
Name,Food,ID
Seagull Seed Rings,bird food,1236468
- Open Integration Builder and select "Create New Integration."
- On the new integration dialog, select File Integration and click OK.
- First, set up how the integration will detect files by setting the scan folder. This is where your trigger files will be dropped and the integration will pick them up. For my example, I used a folder on the C drive. Avoid locations such as My Documents or the Desktop as it requires extra permissions to reach those locations.
- Click on the Location dropdown and select "Computer/Network"
- Use the Browse button to locate your folder or type the folder name.
- Change the File Pattern to match your file. I am using the default of .dat but you can use .txt, .csv, or any type you would like.
- Scroll down to the bottom of this section. If you are using a *.txt file pattern, change the "After Detection" options to a different file extension so the integration will not repeatedly pick up the same file again and again.
- On the lefthand menu, click the Print Document action.
- In the Document section, select the document which will be printed when the integration triggers.
- Click on the Print Options tab. Under the Database Overrides section, click the "Add database override" button. Change the Data Source to Variable. Select EventData on the Variable dropdown list.
- The (The default database) option is selected by default when you have not imported the document settings. It specifies that the first document-level database connection in the document will be overridden. It does not refer to table objects or data entry control database connections. If you instead want to override a table object or data entry control database connection, or you know the name of the connection, you can select an existing name in the Database to override list or click Add and type the name in the Database to override text field to add a new connection.
- Save your integration.
- Click the Test Integration button on the toolbar at the top.
- Click the green Start button in the top right corner.
- In File Explorer, drag the CSV trigger file into the scan folder. The integration will trigger and a label will be printed.
Deploying the integration
After you've tested the integration, you want to deploy it into production.
- Click the Deploy tab then Deploy button on the top toolbar. If there are any changes, you will be prompted to save your integration file before continuing.
- Click the dropdown list and select "This Computer" to deploy locally. Click Next.
- Leave Deploy Now selected and click Finish.
- After a moment, the Administration Console will open and the integration will show as deployed and running.
Applicable to
BarTender 2021
Information
Setting up the label
First, begin by setting up the label file and connecting it to a dabase. You can use your own CSV or save this simple sample database in a text or CSV file:
Name,Food,ID
Seagull Kitty Snax,cat treats,12334668
BarTender Dog Bones,dog food,25346489
- Create a new label and connect to the text database. If you're not familiar with the process, check out Getting started with database connections (Video - 5:20).
- In the toolbox (default location is on the left side of the UI), click the Data Sources tab.
- Click and drag a database field from this toolbox and drop it on the label design area. Repeat this for each database field you wish to add to the label.
- Save the label.
Creating the integration
For your integration, you will need a trigger file. The file must match the database format you used with the label. So a CSV trigger must match a CSV database and tab delimited database must have a tab delimited trigger. If you used the example above, here's a sample trigger file to use:
Name,Food,ID
Seagull Seed Rings,bird food,1236468
- Open Integration Builder and select "Create New Integration."
- On the new integration dialog, select File Integration and click OK.
- First, set up how the integration will detect files by setting the scan folder. This is where your trigger files will be dropped and the integration will pick them up. For my example, I used a folder on the C drive. Type the folder name or use the Browse button to locate it. Avoid locations such as My Documents or the Desktop as it requires extra permissions to reach those locations.
- Change the File Pattern to match your file. I am using the default of .dat but you can use .txt, .csv, or any type you would like.
- Scroll down to the bottom of this section. If you are using a *.txt file pattern, change the "After Detection" options to a different file extension so the integration will not repeatedly pick up the same file again and again.
- On the lefthand menu, click the Print Document action.
- In the Document section, select the document which will be printed when the integration triggers
- Click on the Print Options tab. Under the Database Overrides section, click the "Add database override" button. Change the Data Source to Variable. Select EventData on the Variable dropdown list.
- The (The default database) option is selected by default when you have not imported the document settings. It specifies that the first document-level database connection in the document will be overridden. It does not refer to table objects or data entry control database connections. If you instead want to override a table object or data entry control database connection, or you know the name of the connection, you can select an existing name in the Database to override list or click Add and type the name in the Database to override text field to add a new connection.
- Save your integration.
- Click the Test Integration button on the toolbar at the top.
- Click the green Start button in the top right corner.
- In File Explorer, drag the CSV trigger file into the scan folder. The integration will trigger and a label will be printed.
Deploying the integration
After you've tested the integration, you want to deploy it into production.
- Click the Deploy tab then Deploy button on the top toolbar. If there are any changes, you will be prompted to save your integration file before continuing.
- Click the dropdown list and select "This Computer" to deploy locally. Click Next.
- Leave Deploy Now selected and click Finish.
- After a moment, the Administration Console will open and the integration will show as deployed and running.
Applicable to
BarTender 2019
Information
Setting up the label
First, begin by setting up the label file and connecting it to a dabase. You can use your own CSV or save this simple sample database in a text or CSV file:
Name,Food,ID
Seagull Kitty Snax,cat treats,12334668
BarTender Dog Bones,dog food,25346489
- Create a new label and connect to the text database. If you're not familiar with the process, check out Getting started with database connections (Video - 5:20).
- In the toolbox (default location is on the left side of the UI), click the Data Sources tab.
- Click and drag a database field from this toolbox and drop it on the label design area. Repeat this for each database field you wish to add to the label.
- Save the label.
Creating the integration
For your integration, you will need a trigger file. The file must match the database format you used with the label. So a CSV trigger must match a CSV database and tab delimited database must have a tab delimited trigger. If you used the example above, here's a sample trigger file to use:
Name,Food,ID
Seagull Seed Rings,bird food,1236468
- Open Integration Builder and select "Create New Integration."
- On the new integration dialog, select File Integration and click OK.
- First, set up how the integration will detect files by setting the scan folder. This is where your trigger files will be dropped and the integration will pick them up. For my example, I used a folder on the C drive. Type the folder name or use the Browse button to locate it. Avoid locations such as My Documents or the Desktop as it requires extra permissions to reach those locations.
- Change the File Pattern to match your file. I am using the default of .dat but you can use .txt, .csv, or any type you would like.
- Scroll down to the bottom of this section. If you are using a *.txt file pattern, change the "After Detection" options to a different file extension so the integration will not repeatedly pick up the same file again and again.
- On the lefthand menu, click the Print Document action.
- In the Document section, select the document which will be printed when the integration triggers
- Click on the Print Options tab. Under the Database Overrides section, click the checkbox and keep the default option of "Integration Input Data"
- Save your integration.
- Click the Test Integration button on the toolbar at the top.
- Click the green Start button in the top right corner.
- In File Explorer, drag the CSV trigger file into the scan folder. The integration will trigger and a label will be printed.
Deploying the integration
After you've tested the integration, you want to deploy it into production.
- Click the Deploy tab then Deploy button on the top toolbar. If there are any changes, you will be prompted to save your integration file before continuing.
- Click the dropdown list and select "This Computer" to deploy locally. Click Next.
- Leave Deploy Now selected and click Finish.
- After a moment, the Administration Console will open and the integration will show as deployed and running.
Applicable to
BarTender 2016
Information
Setting up the label
First, begin by setting up the label file and connecting it to a dabase. You can use your own CSV or save this simple sample database in a text or CSV file:
Name,Food,ID
Seagull Kitty Snax,cat treats,12334668
BarTender Dog Bones,dog food,25346489
- Create a new label and connect to the text database. If you're not familiar with the process, check out Getting started with database connections (Video - 5:20).
- Create a text object on the label design area.
- Right click on the label and select properties.
- Select the data source from the list. It'll say "Sample Text."
- Select the box next to Embedded Data and select Database Field from the list. Click next.
- Pick a field of your choice. Click finish.
- Add multiple text objects linked to database fields if you desire.
- Save the label.
Creating the integration
For your integration, you will need a trigger file. The file must match the database format you used with the label. So a CSV trigger must match a CSV database and tab delimited database must have a tab delimited trigger. If you used the example above, here's a sample trigger file to use:
Name,Food,ID
Seagull Seed Rings,bird food,1236468
- Open Integration Builder and select "Create New Integration."
- On the new integration dialog, select File Integration and click OK.
- First, set up how the integration will detect files by setting the scan folder. This is where your trigger files will be dropped and the integration will pick them up. For my example, I used a folder on the C drive. Type the folder name or use the Browse button to locate it. Avoid locations such as My Documents or the Desktop as it requires extra permissions to reach those locations.
- Change the File Pattern to match your file. I am using the default of .dat but you can use .txt, .csv, or any type you would like.
- Scroll down to the bottom of this section. If you are using a *.txt file pattern, change the "After Detection" options to a different file extension so the integration will not repeatedly pick up the same file again and again.
- On the lefthand menu, click the Print Document action.
- In the Document section, select the document which will be printed when the integration triggers
- Scroll down and under the Database Overrides section, click the checkbox and keep the default option of "Integration Input Data"
- Save your integration.
- Click the Test Integration button on the toolbar at the top.
- Click the green Start button in the top right corner.
- In File Explorer, drag the CSV trigger file into the scan folder. The integration will trigger and a label will be printed.
Deploying the integration
After you've tested the integration, you want to deploy it into production.
- Click the Deploy button on the top toolbar. If there are any changes, you will be prompted to save your integration file before continuing.
- Give the integration a name and description if you desire. If none are given, it uses the information from the integration file itself to fill this in.
- Click OK.
- After a moment, the Administration Console will open and the integration will show as deployed and running.
Additional resources