How to play a Feedback Sound when a barcode is found inside a CSV file

Last updated: Apr 28th 2021

If you want to check whether a specific barcode is present inside a CSV file by receiving a sound alert after scanning it with your smartphone, this is the guide for you.

 

Notice: if you want it to always emit a sound, check the “Enable camera beep” option from the app settings and make sure that the smartphone Media volume is turned up.

 

How it works?

  1. The app acquires the barcode and sends it to the server
  2. The server will search for the barcode value inside the specified CSV file
  3. The server will reply to the app with the search result
  4. The app will evaluate the result and emit a specific sound

 

The Output Template

It looks like this:

output template

➡️ It contains a BARCODE component to instruct the app to acquire a barcode, and a CSV_LOOKUP component used to search the barcode value inside a CSV file.

➡️ Once a barcode is found it’ll write the search result to the csv_lookup variable.

➡️ After that there are two IF sections, the first one tests the csv_lookup == "not_found" condition and the second csv_lookup != "not_found".

The BEEP and ALERT components are used to create a sound and a pop-up message.

 
 
 

🧐 Did you get lost?

Don’t worry, you don’t have to understand how it works. Just follow the instructions below.

Instructions

 
Step 1 – Download the Output template

Download the template file –> CSV Alert.btpt
Then double-click on it. (The server will automatically import it to the settings page)

 
Step 2 – Edit the CSV_LOOKUP component

1. Open the server settings by clicking the gear icon
2. Select the imported template “CSV Alert”, and click on the CSV_LOOKUP component:
3. Select the CSV Input file path that you want to use as database

Like this:

☝️ Suggestion: use a simple path such as C:\data.csv to avoid typos. Once you get it to work change it to whatever path you want.

 
The file you provide can contain multiple columns, for example:

12345,Box
12346,Packet
12347,Envelope
12348,Bag

The lookup will be performed on the first column by default.

 
Step 3 – Scan from the smartphone

Open the app, tap the scan button (camera icon) and select the correct Output template:

output template selection

 
Once you scan a barcode you’ll get an alert message with a sound alert.

In this example, the barcode 12345 is found and generates a Success message, and the 12340 barcode generates an Error message.

csv lookup
csv lookup not found

 
 

Step 4 – (Optional) Disable Keyboard Emulation

If you’re using Barcode to PC only to perform the barcode search, and you don’t want the output to interfere with other programs, you may want to disable the Enable Keyboard Emulation option from the server settings:

disable_keyboardemulation

Step 5 – (Optional) change the beep sound

If you don’t like the sound, you can change it by clicking the green BEEP component on the server settings:

file path

Comments

  1. Can I use a beep to alert and not allow the amount to be entered?
    IF it is in the csv, it allows you to enter the quantity, ELSE is in the csv, scan again

    1. Yes, it can be done, you only need to enable the Skip Output option for the BARCODE component and add a JAVASCRIPT COMPONENT to output the barcode variable inside the IF/ENDIF block.

      Like this:
      output template

      You can download this Output Template here: CheckQuantity.btpt

      You’ll need to adjust the database path in both CSV_LOOKUP and Append to .csv file option, like shown here.

Your email address will not be published. Required fields are marked *

Related posts