cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

Hey @Anonymous,

 

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

Hey @Anonymous,

 

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

Anonymous
Not applicable


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

 

 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (21,601)