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

Change focus basing on typed text

Hello everyone,

I have a task to write simple app, which will work on an industrial long range barcode scanner.

Basically I have few form with text inputs, where the users will scan some barcodes.

I can not use barcode plugin from powerapps, because it uses camera and not the scanner in the device.

My problem is - after the user scan some barcode, the software always ends such scan with a CRLF, so i have 1234567890CRLF.

I want to automatically change a focus to another text input after the user scanned something to a field. I tried to do it with OnChange Event, but it does not work until the focus is lost which is not an option, because it has to be done automatically.

How to do it in powerapps?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Change focus basing on typed text

Hi @empe2,

Please try this.

1. Set App.OnStart property as follows to create a blank collection with ID, the number of rows is based on number of text inputs

ClearCollect(ColScan,{ID:1,Value:""},{ID:2,Value:""},{ID:3,Value:""});Set(VarID,1)

2. Set BarcodeScanner1.OnScan as follows, save scan value into the collection in turn.

Patch(ColScan,LookUp(ColScan,ID=VarID),{Value:BarcodeScanner1.Value});Set(VarID,VarID+1)

3. Set the 1st Text input.Default property: LookUp(ColScan,ID=1).Value

Set the 2nd Text input.Default property: LookUp(ColScan,ID=2).Value

Set the 3rd Text input.Default property: LookUp(ColScan,ID=3).Value

Snipaste_2020-04-23_17-49-39.png

This works well on my side, please have a try to see if this works for your case.

Sik

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Change focus basing on typed text

Hi @empe2,

Please try this.

1. Set App.OnStart property as follows to create a blank collection with ID, the number of rows is based on number of text inputs

ClearCollect(ColScan,{ID:1,Value:""},{ID:2,Value:""},{ID:3,Value:""});Set(VarID,1)

2. Set BarcodeScanner1.OnScan as follows, save scan value into the collection in turn.

Patch(ColScan,LookUp(ColScan,ID=VarID),{Value:BarcodeScanner1.Value});Set(VarID,VarID+1)

3. Set the 1st Text input.Default property: LookUp(ColScan,ID=1).Value

Set the 2nd Text input.Default property: LookUp(ColScan,ID=2).Value

Set the 3rd Text input.Default property: LookUp(ColScan,ID=3).Value

Snipaste_2020-04-23_17-49-39.png

This works well on my side, please have a try to see if this works for your case.

Sik

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

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!

Top Solution Authors
Top Kudoed Authors
Users online (8,405)