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 / Filter Gallery by Barc...
Power Apps
Answered

Filter Gallery by Barcode Scanner And/Or Search box.

(0) ShareShare
ReportReport
Posted on by

I have figured out how to filter my Gallery by both the Barcode Scanner and the Search Box, but I don't know how to write a formula for the Gallery that will allow me to do both.

 

Barcode Scan Method:

Scanner --> OnScan = Set(V1,BarcodeScanner1.Value)

Gallery --> Items = Filter(Table2,'Alias Item Number'=V1)

 

Search Box Method:

Gallery --> Filter(Table2,StartsWith(Alias Item Number,SearchBox.Text))

 

I'm sure this is an easy fix, but I am not very familiar with the PowerApps syntax

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

    If understand right, you want the gallery to filter by the Barcode Scan (if something was scanned), then if nothing was scanned, filter by the search box?

    The gallery's Items property could be something like:

    If(
        IsBlank(SearchBox.Text),
            Filter(
                Table2,'Alias Item Number' =V1
            ),
            Filter(
                Table2,StartsWith('Alias Item Number', SearchBox.Text
            )
    )

    I'm not really sure you need the "StartsWith" as part of your search, but that could work just fine. You'll want to ensure that you have a way to clear either/both of V1 and the SearchBox (to avoid someone scanning something then trying to use the search box, or vice-versa).

    Let me know if I misunderstood/if I was close!

    Edit: I'm unsure if you'll run into delegation issues after sometime, but that's another story.

  • v-albai-msft Profile Picture
    on at

    Hi @Anonymous ,

    I just provided my solution in another thread you post before. You can refer to my answer there. If you still have any question about this requirement, don't hesitate to ask me:

    Scan Barcode and/or Search Filter - Power Platform Community (microsoft.com)

    Best regards,

    Allen

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard