# Barcode Scanner Integration and Auto Click Submit

**URL:** https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078
**Category:** Get Answers
**Created:** [April 25, 2024, 5:12am UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078 "2024-04-25T05:12:34Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![ChristopherB](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@ChristopherB](https://forums.knack.com/u/ChristopherB)
#### Post date: [April 25, 2024, 5:12am UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/1 "2024-04-25T05:12:34Z")

</div>

Hello everyone, I have a database system with various fields for an online store. The issue is that we are trying to implement invoicing via barcode scanners.

Right now I have a bluetooth barcode scanner with an iPad set up with the direct view knack system.

The fields are (Quantity) (Item) then a Submit Button.

In a perfect world I wish I didn’t have Quantity and have to manually submit every time I scan 1 barcode.

I know some scanners offer an enter suffix which at most populates the (Item) Field. Does anyone have workarounds or experience in scanning system similiar to a self checkout at a store?

---

<div class="post-metadata">

### Author: ![ChrisPetty](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/chrispetty/32/1216_2.png) [@ChrisPetty](https://forums.knack.com/u/ChrisPetty)
#### Post date: [April 25, 2024, 7:07pm UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/2 "2024-04-25T19:07:19Z")

</div>

Romel, do you have a Knack form setup for this? I’m not familiar with what the direct view knack system is. If it is a form, do you have two input fields; Quantity, Item and then a Submit button? Or, are you doing this another way?

---

<div class="post-metadata">

### Author: ![CSWinnall](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/cswinnall/32/3631_2.png) [@CSWinnall](https://forums.knack.com/u/CSWinnall)
#### Post date: [April 25, 2024, 8:00pm UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/3 "2024-04-25T20:00:12Z")

</div>

Hi romel

I would suggest looking at KTL.

> **[Keywords](https://github.com/cortexrd/Knack-Toolkit-Library/wiki/Keywords#_afsg---auto-fill-and-submit--generate-qr)**
>
> Knack Toolkit Library. Contribute to cortexrd/Knack-Toolkit-Library development by creating an account on GitHub.

@NormandDefayette_CortexRD is very responsive should you need help.

Craig

---

<div class="post-metadata">

### Author: ![NormandDefayette\_CortexRD](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/normanddefayette_cortexrd/32/855_2.png) [@NormandDefayette\_CortexRD](https://forums.knack.com/u/NormandDefayette_CortexRD)
#### Post date: [April 27, 2024, 7:06pm UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/4 "2024-04-27T19:06:05Z")

</div>

Hi @ChristopherB,

Yes, Craig is right. The KTL handles this very well and can even do more. You can have a combination of pre-defined field data along with user input, and even auto-submit after a specific delay.

You can try a demo here: [Knack](https://ctrnd.knack.com/ktl-tutorials#ktl-demo-page/)

To see the **QR code page** , click on **Home** , enter the pre-defined log-in email and password and go to the **Auto Fill and Submit QR Generator** menu.

Let me know if that sounds interesting.  
Norm

---

<div class="post-metadata">

### Author: ![ChristopherB](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@ChristopherB](https://forums.knack.com/u/ChristopherB)
#### Post date: [May 25, 2024, 7:44am UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/5 "2024-05-25T07:44:44Z")

</div>

Yes, I do have a quantity and item field, the item field searches from a product data table

---

<div class="post-metadata">

### Author: ![ChristopherB](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@ChristopherB](https://forums.knack.com/u/ChristopherB)
#### Post date: [May 25, 2024, 7:45am UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/6 "2024-05-25T07:45:42Z")

</div>

In regard to the other replies, unfortunately I don’t use QR Codes, I use regular barcodes and the scanner scans and inputs the SKU that matches in the item field by searching the product list I have.

---

<div class="post-metadata">

### Author: ![NormandDefayette\_CortexRD](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/normanddefayette_cortexrd/32/855_2.png) [@NormandDefayette\_CortexRD](https://forums.knack.com/u/NormandDefayette_CortexRD)
#### Post date: [June 3, 2024, 4:21pm UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/7 "2024-06-03T16:21:09Z")

</div>

Hi Romel,

What you want to do is pretty simple. I do this a lot with my current project.

It’s possible to have a barcode (typically Code128 automatic) that is generated by the KTL with a format that contains all you need (qty, SKU, price, etc).

Then, when this printed (or displayed) barcode is scanned while being in a Knack form, the KTL will split all values and auto-populate them in their respective fields. You can also set the system to wait a specific amount of time and auto-submit if you want.

Let me know if this is what you need to do.  
Norm

---

<div class="post-metadata">

### Author: ![ChristopherB](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@ChristopherB](https://forums.knack.com/u/ChristopherB)
#### Post date: [June 4, 2024, 5:59pm UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/8 "2024-06-04T17:59:58Z")

</div>

> [@NormandDefayette\_CortexRD](#):
>
> It’s possible to have a barcode (typically Code128 automatic) that is generated by the KTL with a format that contains all you need (qty, SKU, price, etc).

Thank you so much. I do have KTL on my app. Tbh the one I need most now is that with Stephen’s submit function, I would like for the same view to reload with the cursor back on the same field.

---

<div class="post-metadata">

### Author: ![CSWinnall](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/cswinnall/32/3631_2.png) [@CSWinnall](https://forums.knack.com/u/CSWinnall)
#### Post date: [June 4, 2024, 7:52pm UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/9 "2024-06-04T19:52:45Z")

</div>

Hi Romel

You could use a view renders and some JavaScript to do this. In the view render add this JavaScript:

```auto
$('#field_xyz').focus();

```

Craig

---

<div class="post-metadata">

### Author: ![CSWinnall](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/cswinnall/32/3631_2.png) [@CSWinnall](https://forums.knack.com/u/CSWinnall)
#### Post date: [June 4, 2024, 7:54pm UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/10 "2024-06-04T19:54:34Z")

</div>

Norm has an autofocus function you could use:

> **[Features Overview](https://github.com/cortexrd/Knack-Toolkit-Library/wiki/Features-Overview#functions-5)**
>
> Knack Toolkit Library. Contribute to cortexrd/Knack-Toolkit-Library development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![NormandDefayette\_CortexRD](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/normanddefayette_cortexrd/32/855_2.png) [@NormandDefayette\_CortexRD](https://forums.knack.com/u/NormandDefayette_CortexRD)
#### Post date: [June 4, 2024, 7:55pm UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/11 "2024-06-04T19:55:52Z")

</div>

Hi Romel,

From what I see in the other thread with Stephen, you have a dropdown selector that needs to be searched. This becomes a two-step process where you must wait for the search outcome before submitting.

And what happens if the search fails? Should not submit for sure and pop up a timed error message.

This is why the KTL has been created: to address all possible use cases without any specific code.

I will see how I can do this with a new keyword: **\_bcr** (Barcode Reader)

You’ll be able to specify the barcode format, and which field each portion should populate (called the mapping).

Example:

\_bcr=[SKU, 10, 0, Price, 5, 2], [auto, submit, 2.5]

1. Will extract the first 10 digits without decimals and search the SKU connected field
2. will extract the next 5 digits and populate the Price field with a 3-digit value having 2 decimals.
3. Once search in dropdown resumes successfully…
4. Will wait 2.5 seconds
5. Click Submit

How’s that?

Norm

---

<div class="post-metadata">

### Author: ![NormandDefayette\_CortexRD](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/normanddefayette_cortexrd/32/855_2.png) [@NormandDefayette\_CortexRD](https://forums.knack.com/u/NormandDefayette_CortexRD)
#### Post date: [June 6, 2024, 6:30am UTC](https://forums.knack.com/t/barcode-scanner-integration-and-auto-click-submit/16078/12 "2024-06-06T06:30:12Z")

</div>

Hi @ChristopherB,

I’ve finished the barcode feature I mentioned above.

New keyword: **\_bcr**

You can try it here: [https://ctrnd.knack.com/ktl-tutorials#ktl-demo-page/barcodes/barcode-reading-automation/](https://ctrnd.knack.com/ktl-tutorials#ktl-demo-page/barcodes/barcode-reading-automation/)

Just scan one of the barcodes you see at the top, and the form will auto-populate, search the Lot number in the dropdown and if found, will submit the form after 2 seconds.

You can keep going on indefinitely, only requiring a pause due to the submit delay + 2 seconds from the keyword.

I’ve chosen a prefix with two colons **::** followed by 3 fields.

Here’s what the Builder’s view looks like:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/b/b6359e27737d17cb16f0379456a196c1bae47d97.jpeg)

Hope you like it,  
Norm

P.S. This is sneak peek of what will be in **KTL v0.25.5**
