cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
grabear
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
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
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

grabear
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?

 

 

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,260)