cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
empe2
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
v-siky-msft
Community Support
Community Support

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
v-siky-msft
Community Support
Community Support

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,413)