cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
Power Apps
Power Apps

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
Highlighted
Power Apps
Power Apps

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

Highlighted
New Member

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?

 

 

Highlighted
Power Apps
Power Apps

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,813)