web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : D+RR0ZZ4CfQ400V+OHc/OT
Power Apps - Building Power Apps
Answered

Variables and input controls issue (keypad vs scanner input)

Like (0) ShareShare
ReportReport
Posted on 19 Apr 2023 17:08:09 by 155

I have a PowerApp that I am using to log students as they come in.  I want to allow them to enter their ID numbers via numeric pad as well as scan their ID cards.  I have a variable for the Student ID and a TextInput for the Student ID.  The Student ID TextInput has its default value set to the VAR_StudentID variable.  For each keypad number I have the following code:

 

Set(VAR_StudentID, Concatenate(VAR_StudentID, "1"))

 

Then I have a field where I lookup their names based on the Student ID entered with the following code:

 

LookUp('All Students', OtherID=VAR_StudentID, StudentName)

 

Problem: When I use the scanner to populate the Student ID TextInput directly instead of using the keypad, it does not do the lookup for the student name because the variable VAR_StudentID doesn't have any value because the TextInput was set directly.

 

I cannot figure out how to get both scenarios to work (keypad vs. scanner).  Screenshot is attachedScreenshot 2023-04-19 095146.jpg.

 

Categories:
  • mhenderlight Profile Picture
    155 on 19 Apr 2023 at 19:54:48
    Re: Variables and input controls issue (keypad vs scanner input)

    Awesome, that worked just fine, thanks!

  • Verified answer
    mmollet Profile Picture
    3,187 on 19 Apr 2023 at 19:50:47
    Re: Variables and input controls issue (keypad vs scanner input)

    Oh ok. You could add a check in button that would kick off everything you want to do after the value is in the text input box. You could also try to use the on change property to update the same variable you use with the keypad when you scan something into that input box: OnChange: Set(VAR_StudentID, Self.Text)

     

    Unfortunately I dont have a way to test this for you to be sure of a solution.

  • mhenderlight Profile Picture
    155 on 19 Apr 2023 at 19:23:55
    Re: Variables and input controls issue (keypad vs scanner input)

    I'm using an external bar code scanning device which is not supported by the BarcodeReader control in PowerApps so this solution will not work for me.

  • mmollet Profile Picture
    3,187 on 19 Apr 2023 at 17:28:09
    Re: Variables and input controls issue (keypad vs scanner input)

    I would just use the scanner to update the variable instead of the actualy text input. I havent used the new scanner but I imagine something like this would work:

    OnScan -> Set(VAR_StudentID, First(BarcodeReader.Barcodes).Value); Reset(BarcodeReader);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete