cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
diegopuron
Frequent Visitor

Search using a barcode

Hello there,

 

I have my Powerapp up and running, but now i am going to print labels for all my equipment, and i have thought in including a barcode scanner search function if i need to edit any item in the future. I just want to scan the barcode, and go straight to that particular item. I have included the barcode, and i have managed to send the code to the searchbox, by setting the Default in the Textbox to "BarcodeScanner1". But once the number is on the textbox, it doesn't do anything. What do i need to change to get the app searching that particular item and showing it and only it on the screen, so i can edit it if needed. I don't need the EditScreen,i just need the gallery to show my that item.

 

I hope i have explained it so you can understand me what i want...

 

Many thanks people!

 

Diego Puron

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @diegopuron ,

Based on the needs that you mentioned, I have made a test on my side, and don't have the issue that you mentioned.

 

I have made a test on my side, please take a try with the following workaround:

Set the OnScan property of the Barcode Scanner control to following:

Set(SearchValue, BarcodeScanner1.Value)

Set the Default property of the Text Search box  (TextSearchBox1) to following:

If(!IsBlank(SearchValue), SearchValue)

Set the Items property of the Gallery to following:

If(
!IsBlank(TextSearchBox1.Text),
Filter('YourDataSource', TextSearchBox1.Text in FilteredColumn), /* <-- FilteredColumn represents the column in your data source, which you want to compare with the search value -- scanned barcode value */
'YourDataSource'
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-xida-msft
Community Support
Community Support

Hi @diegopuron ,

Based on the needs that you mentioned, I have made a test on my side, and don't have the issue that you mentioned.

 

I have made a test on my side, please take a try with the following workaround:

Set the OnScan property of the Barcode Scanner control to following:

Set(SearchValue, BarcodeScanner1.Value)

Set the Default property of the Text Search box  (TextSearchBox1) to following:

If(!IsBlank(SearchValue), SearchValue)

Set the Items property of the Gallery to following:

If(
!IsBlank(TextSearchBox1.Text),
Filter('YourDataSource', TextSearchBox1.Text in FilteredColumn), /* <-- FilteredColumn represents the column in your data source, which you want to compare with the search value -- scanned barcode value */
'YourDataSource'
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is perfect and just what I needed.  How would I go about sorting this by a certain column?

Hi @v-xida-msft 

Thanks for the great answer.

However, is there a way to clear the SearchBox when clicking [X] button to go back 

Reset (searchbox)

doesn't work,

nor 

UpdateContext({ClearSearch:true});UpdateContext({ClearSearch:false})

 

 

This partially works for me. The issue for me is after I search once using the barcode scanner it will not search again with the scanner, until I close the app and re-open.

Im testing out the same thing tonight, and have the exact same issue. Any suggestions?

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (3,971)