web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / filter gallery from te...
Power Apps
Answered

filter gallery from text part

(0) ShareShare
ReportReport
Posted on by 25

I have this scenario: one barcode scanner button and gallery from sharepoint list. I want to filter this gallery only from part of the text of scanned barcode. How can i do this filter?

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @aaronraja 

    You can use the MID function to extract a partial string from your barcode scanner control.

    Filter(your_datasource_name, EAN = Mid(Barcode1.Value, 4, 13)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • aaronraja Profile Picture
    25 on at

    Thanks for the answer, but if the data is in other position inside the text? The code searched int the gallery is every time with 13 digits but the position in the barcode could by in other position.

  • mdevaney Profile Picture
    29,989 Moderator on at
    @aaronraja
    You must supply some examples to show what you mean
  • aaronraja Profile Picture
    25 on at

    Yes.

    Tha gallery has this filter: Filter(vTablaArticulos;Mid(BarcodeScanner1.Value;4;13)='Código Barras (EAN)')

    The datasource is a SharePoint list that loads on a collection on start the app to search results fast when the user do a scan.

    The first question is not filtering.

    In test env the code scanned is 01084353548190081120020110testlot, and in the gallery i have one column named LCEAN witch content the value 8435354819008, but dont filter anything with the filter. I dont understand why.

     

    When I scan the code, the data inside text, could by on the fourth position (with 13 digits every time) but if its in other position?

    With that filter you give me the search text every need to bee on start position 4, but if is on 5 o 2, then cant search it. That situation its secundary.

  • mdevaney Profile Picture
    29,989 Moderator on at

    @aaronraja 

    You must give me examples of what the barcode could look like other than the format you supplied.

  • aaronraja Profile Picture
    25 on at
    For example
    01084353548190081120020110testlot
    0102784353548190081120020110testlot
    084353548190081120020110testlot
    The part of barcode i need to compare is 8435345819008
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @aaronraja 
    The barcode always appears the same number of digits from the right so we can use a combination of the LEFT + RIGHT functions here.

     

    Filter(your_datasource_name, EAN = Left(Right(Barcode1.Value, 30), 13))

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • v-xida-msft Profile Picture
    on at

    Hi @aaronraja ,

    Based on the issue that you mentioned, I think the 'in' operator could achieve your needs.

     

    Please consider set the Items property of the Gallery to following:

    Filter(
     vTablaArticulos;
     'Código Barras (EAN)' in BarcodeScanner1.Value
    )

     

    If you want to compare with the LCEAN column, please modify above formula as below:

    Filter(
     vTablaArticulos;
     LCEAN in BarcodeScanner1.Value
    )

     

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

     

    Best regards,

  • aaronraja Profile Picture
    25 on at

    Thanks to all for response, but the problem is that the gallery dont filter. I need to filter the fixed data on column of the gallery, that has 13 digits with the text value on the code scanned that could have variable quatity of digits, but has content de 13 digits of text i would to compare.

    Dont get any thing, but the file exist.

    With option of left and right dont filter too.

     

    Thanks.

  • aaronraja Profile Picture
    25 on at

    To clarify, i have test with the code that loads the collection on the view, but only loads 5 records. And the gallery could filter only with first filter.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard