cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Barcode Scanner - OnScan trigger time

Hi,

 

i'm building a Power Apps application with a barcode scanner.

I use the scanner to scan barcodes from a printed excel list, which is created from an external program.

 

In the excel list all barcodes are in a column with less distance to each other. When i scan a code and the camera points unintentionally on a different barcode, the OnScan event gets triggered immediately.

 

Is there any way to increase the trigger time for the OnScan event? (For example point 2 seconds on a barcode)

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Barcode Scanner - OnScan trigger time

Hi @8530andre :

I tested it on my phone(ios), and the front and rear cameras can recognize the barcode.

I suggest you do this test:

At screen3

1\add a dropdown control(Dropdown3) and set it's items property to:

[0,1,2,3,4]

2\set the web barcode scanner's camera property to:

Dropdown3.Selected.Value

So that you can choose the camera freely .You can try each number and see if it works.

3\Check if the web barcode scanner's BarcodeType property is set correctly.

In addition,I'm afraid this feature is currently not available(use the normal barcodescanner with a time-value which would increase the time the detection of one barcode takes).

You can add an idea in below forum if you need this feature available:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Highlighted
Microsoft
Microsoft

Re: Barcode Scanner - OnScan trigger time

HI @ 8530andre

Do you want find a way to increase the trigger time for the OnScan event?

I think you can easily achieve it with timer control.

Here is my solution:

Step1:

Add a timer(timer1) control and set its property

OnTimerEnd: your formula(which in OnScan property)

Duration :2000 /*means 2s*/

Visible:false

Step2:

set the OnScan property to

Select(timer1)

In this way, the formula in OnScan property will be delayed by 2 seconds.

 

But I think your current problem is that the wrong barcode is scanned. Even if the execution time of the formula is delayed, the barcode value obtained by this barcode scanner control is still wrong. My suggestion is to use the following solution to extend the scanning time to ensure that the correct barcode is scanned

 

Ive made a test for your reference:

1\ you need to enable this feature(file-settings-advanced setings-web barcode scanner)

 

2.png

 

At Initial screen(Screen10)

2\add a button and set its onselect property to:

Navigate(Screen3)

Navigate to the barcode scanner screen

3\add a new screen(screen3)

barcode scanner screen

At screen3

4\add a web barcode scanner control(Barcode1)

5\add a timer control and set its property:

AutoStart:true

Duration:2000 /*wait for 2s*/

OnTimerEnd: If(!IsBlank(Barcode1.Text),Navigate(Screen10)) /* Screen10 is the Initial screen */

Repeat: true

Visible:false

Check the value of Barcode1.Text every two seconds, if not empty, navigate to Initial screen(Screen10)

At Initial screen(Screen10)

6\ add a label control and set its text property to :

Barcode1.Text

You can directly quote Barcode1.Text in the Initial screen(Screen10) according to your needs

 

When a user select the button on Screen10(Initial screen), the app will navigate to Screen3(barcode scanner screen).

On screen 3, the barcode control will automatically scan the barcode. The timer checks the value of Barcode1.Text every two seconds, if is not empty, the user will navigate to screen10.

 

Best Regards,

Bof

 

Highlighted
Frequent Visitor

Re: Barcode Scanner - OnScan trigger time

Hi @v-bofeng-msft,

thank you for your fast answer.

 


But I think your current problem is that the wrong barcode is scanned. Even if the execution time of the formula is delayed, the barcode value obtained by this barcode scanner control is still wrong. My suggestion is to use the following solution to extend the scanning time to ensure that the correct barcode is scanned

That's exactly the problem that i have.

 

 

Thank you about the solution with the web-barcodescanner, but we are scanning the barcodes with android devices (smartphone & tablet) using the rear camera.

 

By default the web-barcodescanner is using the frontkamera, which can be changed with the camera property (default: 0). If I change the value to 2, the rear camera is used for scanning the barcodes. But if I use the rear camera the barcode detection is not possible.

 

Is there any way to change this behavior and to use the web-barcodescanner with a rear camera? 

 

The perfect solution for my problem would be, to use the normal barcodescanner with a time-value which would increase the time the detection of one barcode takes (time before OnScan is triggered), to make sure the user points to the right barcode and not accidentally a wrong one.

 

Best regards

 

Highlighted
Microsoft
Microsoft

Re: Barcode Scanner - OnScan trigger time

Hi @8530andre :

I tested it on my phone(ios), and the front and rear cameras can recognize the barcode.

I suggest you do this test:

At screen3

1\add a dropdown control(Dropdown3) and set it's items property to:

[0,1,2,3,4]

2\set the web barcode scanner's camera property to:

Dropdown3.Selected.Value

So that you can choose the camera freely .You can try each number and see if it works.

3\Check if the web barcode scanner's BarcodeType property is set correctly.

In addition,I'm afraid this feature is currently not available(use the normal barcodescanner with a time-value which would increase the time the detection of one barcode takes).

You can add an idea in below forum if you need this feature available:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

Best Regards,

Bof

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020 Winner Announced

Check it out!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (11,237)