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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery Filter With Se...
Power Apps
Unanswered

Gallery Filter With Search Bar or Barcode

(0) ShareShare
ReportReport
Posted on by 6

I am using the Sharepoint list app template (with a few minor modifications) and want to allow users to either search by typing or search by using a barcode. However, I haven't quite figured out how to get the gallery to allow filtering by both, just one or the other.

 

This is the default code that works which works perfectly for searching my gallery from the search bar, but any injection I've added doesn't allow me to get results from the scanner.

 

SortByColumns(Filter([@'TBC Staging Inventory'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

 

I've also tried to get the scanner to output the results to the search bar, but after scan it doesn't do anything.

OnVisibile (Screen)

 

UpdateContext({scannedValue: Blank()})

 

OnScan (Barcode Scanner)

 

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

 

 Default (Search box)

 

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

 

 

Any input would be greatly appreciated!

Categories:
  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @ajblodgett ,

     

    Assuming the Search box is a Text Input control, try setting it to:

     

    scannedValue

     

     

    Also, you may want to change your BarCodeScanner.OnScan property to:

     

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

     

    Like that you set the variable with the value of the last barcode you scanned instead of the first one which doesn't change if you scan multiple unless you reset the scanner in between scans.

  • ajblodgett Profile Picture
    6 on at

    @BCBuizer 

     

    That still didn't populate the search box.

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @ajblodgett,

     

    Can you please share how you tested the functionality?

  • ajblodgett Profile Picture
    6 on at

    @BCBuizer 

     

    T tested using the barcode scanner on my phone with a barcode that contains something that one of the data cards.

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @ajblodgett ,

     

    Did you make sure that the version of the app you tested on your phone was the one that had these new updates in it? 

     

    It can help to add a hard-coded version number in your app to be sure about the above. Also, for testing, you can add a label to the app in the screen with the scanner that displays the value of the variable so you can verify if that's being populated correctly.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard