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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Barcode reader value t...
Power Apps
Unanswered

Barcode reader value to text box

(0) ShareShare
ReportReport
Posted on by 15

Hello everyone
i am new to powerapp
i am trying to make application with barcode reader to scan barcode on the shelf of medication and view expiry dates stored in my list already and update it
my issue is : I want the barcode reader to show the scanned code in the textbox and conduct searching in gallery and at same time i want the text box to search manually also my medicine name
i tried a lot but nothing success

Meemo_Kath_0-1683719595093.png

this is my list

Meemo_Kath_1-1683719780522.png

and this is my application

pls anyone can help with the correct formula

Categories:
I have the same question (0)
  • Verified answer
    mmollet Profile Picture
    3,187 on at

    create a context variable on your screens onvisible property like this:

    UpdateContext({scannedValue: Blank()})

     

    Now for your onScan property on your scanner add this: 

    UpdateContext({scannedValue: First(BarcodeReader.Barcodes).Value})

     

    Now add the variable scannedValue to your text input box or label or wherever you want the scanned value to be seen. If you want it to also search/filter your gallery then you can try the following in the items property:

    If(IsBlank(ScannedValue), YourListName, Filter(YourListName, Barcode = scannedValue))

    this will show the entire list of the scanned value is blank and will show only matching barcodes if scanned value is not blank

  • Parunyu Profile Picture
    2 on at

    Hi @mmollet 

    If(IsBlank(ScannedValue), YourListName, Filter(YourListName, Barcode = scannedValue))

    When to put the code and properties ?

  • mmollet Profile Picture
    3,187 on at

    This would go in the search box as the default text. What it does is it checks if the scannedvalue is blank. If it is blank then it means that we have no scanned anything to search for so we want to show the entire unfiltered list. If there is an object in that scannedvalue then we want to show that in this textinput so that the gallery filters correctly.

     

    Basically the gallery is filtering based on the value in the text input so we are just controlling that. if the scanner wasnt used then the user can type to search but if the scanner was used then it will search/filter based on that scanned value instead. The user can still backspace that and search by their own values as well.

  • khanf Profile Picture
    2 on at

    Amazin, trying to solve this for last 3 days, no youtube video no google search not even chatGPT had correct solution but yours worked in secounds, thank you so much.

  • EricCheungT Profile Picture
    2 on at

    Hi @mmollet , I have followed you step but failed on the last one, finally nothing come out after scan the barcode. Could you please let me know which step I did wrong? Thanks in advance. I am very new on Power Apps...

    UpdateContext({scannedValue: Blank()}) -> please see capture1.png

    UpdateContext({scannedValue: First(BarcodeReader.Barcodes).Value}) -> capture2.png

    If(IsBlank(scannedValue),'Business Assets', Filter('Business Assets', Barcode = scannedValue)) -> capture3.png
    (My ListName is Business Assets)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard