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

AutoStart Barcode Scan (Always on Scanner)

Hi All,

I have created an Attendance system using barcode scanner that Scan QR code and check-In scanned user. same as check-out.

Each time I have to touch the barcode scanner and then only it starts scanning.

But I need this to be always on scan, which means when I put my QR code to the camera it starts the scan automatically. without touching.

can you please help me to do this?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: AutoStart Barcode Scan (Always on Scanner)

Hi @ShehanPeiris ,

I have to say firstly that I have just tested the below and it seems to work, however I am sure the control was not designed to operate this way.

On the OnScan of your barcode control (I will call it BarcodeScanner1 below), after anything else you have there, put 

Select(BarcodeScanner1)

and it selects and starts the scanner again. I successfully scanned about a dozen items with an iPad, but with no other code happening in the background. Please let me know how this works for you.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Highlighted
Community Support
Community Support

Re: AutoStart Barcode Scan (Always on Scanner)

Hi @ShehanPeiris

Do you want to keep the BarcodeScanner always open(or Automatically open the BarcodeScanner)?

I have 2 solution for your reference:

Solution1: Using a timer to automatically open BarcodeScanner

1\add two screens(barcodescanner screen; successmessage screen)

At barcodescanner screen:

2\add a barcodescanner(BarcodeScanner1) control.

Set its onscan property to:

 

Patch(
Employeetable,   /*my data source*/
LookUp(Employeetable, EmployeeID=BarcodeScanner1.Value),
{
status: “check-In”
}
); /*This code is my demo, you can customize this code according to your needs*/
Navigate(‘successmessage screen’)

 

When the scan is successful, navigate to successmessage screen

3\add a timer control

Set its property

AutoStarttrue

Duration1000  /* means 1s ,modify it as you like*/

OnTimerEnd: Select(BarcodeScanner1);

Reset:true

Visible:false

Wait for 1s then open the camera

At successmessage screen:

4\add a timer control

Set its property

AutoStarttrue

Duration3000  /*means 3s,modify it as you like*/

OnTimerEnd: Navigate(barcodescanner screen)

Reset:true

Visible:false

Wait for 3s then navigate to barcodescanner screen

Solution2: Using web barcode scanner control to keep the camera open.

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

 

2\add a web barcode scanner control(Barcode1)

3\add a timer control and set its property:

AutoStart:true

Duration:2000 /*wait for 2s*/

OnTimerEnd:

 

If(
    !(Barcode1.Text = VarVar),
    Set(
        VarVar,
        Barcode1.Text
    );
    Patch(
Employeetable,   /*my data source*/
LookUp(Employeetable, EmployeeID=VarVar),
{
status: “check-In”
}
)
)

 

Repeat: true

Visible:false

Check the value of Barcode1.Text every two seconds, If Barcode1.Text is updated, the employee status is updated

 

Best Regards,

Bof

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: AutoStart Barcode Scan (Always on Scanner)

Hi @ShehanPeiris ,

I have to say firstly that I have just tested the below and it seems to work, however I am sure the control was not designed to operate this way.

On the OnScan of your barcode control (I will call it BarcodeScanner1 below), after anything else you have there, put 

Select(BarcodeScanner1)

and it selects and starts the scanner again. I successfully scanned about a dozen items with an iPad, but with no other code happening in the background. Please let me know how this works for you.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Highlighted
Community Support
Community Support

Re: AutoStart Barcode Scan (Always on Scanner)

Hi @ShehanPeiris

Do you want to keep the BarcodeScanner always open(or Automatically open the BarcodeScanner)?

I have 2 solution for your reference:

Solution1: Using a timer to automatically open BarcodeScanner

1\add two screens(barcodescanner screen; successmessage screen)

At barcodescanner screen:

2\add a barcodescanner(BarcodeScanner1) control.

Set its onscan property to:

 

Patch(
Employeetable,   /*my data source*/
LookUp(Employeetable, EmployeeID=BarcodeScanner1.Value),
{
status: “check-In”
}
); /*This code is my demo, you can customize this code according to your needs*/
Navigate(‘successmessage screen’)

 

When the scan is successful, navigate to successmessage screen

3\add a timer control

Set its property

AutoStarttrue

Duration1000  /* means 1s ,modify it as you like*/

OnTimerEnd: Select(BarcodeScanner1);

Reset:true

Visible:false

Wait for 1s then open the camera

At successmessage screen:

4\add a timer control

Set its property

AutoStarttrue

Duration3000  /*means 3s,modify it as you like*/

OnTimerEnd: Navigate(barcodescanner screen)

Reset:true

Visible:false

Wait for 3s then navigate to barcodescanner screen

Solution2: Using web barcode scanner control to keep the camera open.

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

 

2\add a web barcode scanner control(Barcode1)

3\add a timer control and set its property:

AutoStart:true

Duration:2000 /*wait for 2s*/

OnTimerEnd:

 

If(
    !(Barcode1.Text = VarVar),
    Set(
        VarVar,
        Barcode1.Text
    );
    Patch(
Employeetable,   /*my data source*/
LookUp(Employeetable, EmployeeID=VarVar),
{
status: “check-In”
}
)
)

 

Repeat: true

Visible:false

Check the value of Barcode1.Text every two seconds, If Barcode1.Text is updated, the employee status is updated

 

Best Regards,

Bof

View solution in original post

Highlighted
Frequent Visitor

Re: AutoStart Barcode Scan (Always on Scanner)

Hi @WarrenBelz ,
yes, you are correct. I used Select() method to auto start the reader with timer control and it works well now.

Thank you very much for your support.

Highlighted
Frequent Visitor

Re: AutoStart Barcode Scan (Always on Scanner)

Hi @v-bofeng-msft ,
I did exactly the same way. used scanner screen, success screen and after 5 seconds it comes back to scanner screen, the scanner starts again, once finish navigate to success or failed screen likewise I have created my app with timer controls.

Thanks a lot for your support, this really helped me a lot.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,731)