cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
grabear
Level: Power Up

Barcode scanner control values in my collection are not filtering my table.

@mobaky
That's what I've been using :

# I have a table in an excel file called "Saliva"

# In the OnScan property for the barcode scanner:
Collect(BarcodeData, {SN: BarcodeScanner2.Value})

# In the Items property of the gallery:
Filter(Saliva, Sample_Number in BarcodeData.SN)

# In the title's text property:
ThisItem.Sample_Name

# In the subtitle's text property:
ThisItem.Sample_Number


In this example my barcode data relates to my "Sample_Number" column in the Saliva table.  However, I've tried this with several other columns as well.  The gallery will display my filtered table perfectly when I use a Text Input, but the Barcode Scanner never works..

 

I also tried several things per your suggestion in an issue that I filed on GitHub:

 

https://github.com/MicrosoftDocs/powerapps-docs/issues/174

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff mobaky
PowerApps Staff

Re: Barcode scanner control values in my collection are not filtering my table.

Hey @grabear,

 

I've tried your formulas on a sample app and I was wrong, it looks like you are using the formulas correctly. I'd like to clarify a few things to see if we can pinpoint what the issue is:

 

  • Have you checked that the Barcode values are being added to the BarcodeData collection ( Display in a seperate gallery)
  • Are there any extra spaces or letter casing difference in your excel values and Barcode data you can use the Trim() and Upper() functions for both :
    Filter(Saliva, Trim(Sample_Number)in Trim(BarcodeData.SN))

View solution in original post

3 REPLIES 3
PowerApps Staff mobaky
PowerApps Staff

Re: Barcode scanner control values in my collection are not filtering my table.

Hey @grabear,

 

I've tried your formulas on a sample app and I was wrong, it looks like you are using the formulas correctly. I'd like to clarify a few things to see if we can pinpoint what the issue is:

 

  • Have you checked that the Barcode values are being added to the BarcodeData collection ( Display in a seperate gallery)
  • Are there any extra spaces or letter casing difference in your excel values and Barcode data you can use the Trim() and Upper() functions for both :
    Filter(Saliva, Trim(Sample_Number)in Trim(BarcodeData.SN))

View solution in original post

grabear
Level: Power Up

Re: Barcode scanner control values in my collection are not filtering my table.


  •  Have you checked that the Barcode values are being added to the BarcodeData collection ( Display in a seperate gallery)

Yes, I made another screen so that I could see and make sure the collection is being updated. 

 


  • Are there any extra spaces or letter casing difference in your excel values and Barcode data you can use the Trim() and Upper() functions for both :
    Filter(Saliva, Trim(Sample_Number)in Trim(BarcodeData.SN))

I've been wondering about this...  Trim works!!  Thank you!!

 

Looking at my Barcode, my Excel table, and the scanned barcode value, you don't really see any spaces or anything.  So why is that the problem?

 

 

PowerApps Staff mobaky
PowerApps Staff

Re: Barcode scanner control values in my collection are not filtering my table.

Oh great, I'm glad that worked for you. That's interesting, a trailing space might be ignored by the gallery (not sure) but you might try to use the Len() function to see which source has the extra space.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,035)