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 / Filter gallery from sc...
Power Apps
Unanswered

Filter gallery from scanner button

(0) ShareShare
ReportReport
Posted on by 2

Hey everyone, sort of new to PowerApps. I've searched and found some similar stuff but was still a little confused since my situation is different.

App Objective: Scan a tool in it with the barcode scanner, and show me the details in the list that is in a table. But all this detalis in a different screen.

Tree View

TreeView.JPG

 

My Table: 

Table.JPG

Currently my list is coded whit a column whith the code:

BarCodeScanner1 On Scan: Navigate(Screen1; ScreenTransition.None)

Label4 Text BarcodeScanner1.Value

Gallery7_1 Items: Filter([@TablaEquipos], CODIGO_x0020_QR=Value(BarcodeScanner1.Value))

Label3 Text BarcodeScanner1.Value

 

Label3 an Label4 is working ok, and show the scan. But the Gallery7 and Gallery7_1 dont do it.

 

Any help would be greatly appreciated. Thank you

 

 

 

Categories:
  • MiDer Profile Picture
    139 on at

    You could either use a global variable with the SET expression within the OnScan behavior of the barcode scanner control and perform the navigate afterwards, or provide the value as context variable to the next screen.
    See this example from the documentation.

    In your case the expression onScan might look like : 


    BarCodeScanner1 On Scan: Navigate(Screen1; ScreenTransition.None, {cxtVar : BarcodeScanner1.Value} )

    Label4 Text BarcodeScanner1.Value

    Gallery7_1 Items:

    If(Not(IsBlankOrError(cxtVar)),Filter([@TablaEquipos], CODIGO_x0020_QR=Value(cxtVar),[@TablaEquipos])

    Label3 Text cxtVar

    Whereby the column 'CODIGO_x0020_QR' would be formatted as number because of your filter on value().

    For the Gallery7 you would have to catch the case of a blank filter criteria as well.
    Otherwise none of those entries would be shown.
    Referencing controls across multiple screens is also not really known for its performance. 
    Please keep in mind that BarcodeScanner1.value is referenced on Screen1, pointing to your HomeScreen, causing both screens to be kept in memory.

    I do not know what reason you have to define values on one screen and immediately leave it, 
    but would recommend to either use a global variable with Set(varBarCodeScanner, BarcodeSCanner1.Value) , which you can reference anywhere, or provide different context variables during navigate back and forth.
    In any case for the Gallery control you should not define the filter only.

    Some screenshots:
    Filter value is blank()

    • MiDer_0-1661365081200.png


    Filter value has data

    • MiDer_1-1661365101404.png


    BarCode Scanner control is referenced on a complete new blank screen

    • MiDer_2-1661365125946.png

     

  • Cristian2 Profile Picture
    2 on at

    Thank you very much for your answer.

    I made the change that you suggest, and it works showing the result in Label3 in the other screen.
    But the Gallery dont shown nothing.
    You ask me, "I do not know what reason you have to define values on one screen and immediately leave it," and I can say you tha I dont need it. What I need is show the data in the table after Scan a Code bar, just that.

    If you or anybody can help me I will be very grateful 🙂

  • MiDer Profile Picture
    139 on at

    fair enough @Cristian2 😉

    I am unsure if your tables column 'CODIGO_x0020_QR' is formatted as text or number.
    As you mentioned that the gallery filter is not working, I´d try the following.
    Just remove the Value() from the clause.

    Gallery7_1 Items:

    If(Not(IsBlankOrError(cxtVar)),Filter([@TablaEquipos], CODIGO_x0020_QR=cxtVar,[@TablaEquipos])


     

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 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard