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 / Filtering Using 2 Shar...
Power Apps
Unanswered

Filtering Using 2 SharePoint

(1) ShareShare
ReportReport
Posted on by

Hello

 

I have 2 SharePoint List
SP1 (column names)

cEmail

ID

FName

LName

 

SP2

Email
Items

Amount

SP1 is displayed to Gallery1
ThisItem.ID (labelID - name of the object)
ThisItem.cEmail (labelEmaill - name of the object)

If Gallery1 is selected
ClearCollect(MyCollection, Filter( SP2, Items = labelItem.Text && Email = labelEmaill.Text))

Issue:
When I add the " && Email = labelEmaill.Text " it not working or not filtering, but when I removed the Email, it shows all the Items that is equal to labelItem.Text

Categories:
I have the same question (0)
  • CaN2 Profile Picture
    11 on at

    Hello

     

    I have 2 SharePoint List
    SP1 (column names)

    c_Email

    ID

    FName

    LName

     

    SP2 (column names)

    Email
    Items

    Amount

    SP1 is displayed to Gallery1
    ThisItem.ID (labelID - name of the object)
    ThisItem.cEmail (labelEmaill - name of the object)

    If Gallery1 is selected
    ClearCollect(MyCollection, Filter( SP2, Items = labelItem.Text && Email = labelEmaill.Text))

    Issue:
    When I add the " && Email = labelEmaill.Text " it not working or not filtering, but when I removed the Email, it shows all the Items that is equal to labelItem.Text

    Please help. TIA

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @NCa2 ,

    What type of field is Email and can you see the correct matching value in labelEmaill

  • CaN2 Profile Picture
    11 on at

    Email field is Text in SP and yes, it is matched.
    Thank you for your response, @WarrenBelz 

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @NCa2 ,

    If you are selecting from the Gallery

    ClearCollect(
     MyCollection, 
     Filter( 
     SP2, 
     Items = ThisItem.Items && Email = ThisItem.Email
     )
    )

    Calculated labels are often not reliable if you refer to their content for other purposes.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • CaN2 Profile Picture
    11 on at

    ThisItem.Items is not working, but when I removed the "ThisItem"
    It's working fine and showing all the data that is equal to Items(Value), but the email is not working even the
    SP1 email is equal to SP2 email

    I tried with and without ThisItem in Email

  • CaN2 Profile Picture
    11 on at
    @WarrenBelz 
    Gallery1 Items: SP1

    Onselect:
    ClearCollect
    (
       MyCollection,
        Filter(
            SP2,
            Items = labelItems.Text && Email = ThisItem.Email
        )
    );

    Error/Message of the code above
    MyCollection: We didn't find any data

    ________
    I tried this code
    ClearCollect(
       MyCollection,
        Filter(
            SP2,
            Items = labelItems.Text && Email = labelEmail.Text
        )
    );

    and same issue/message
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @CaN2 ,

    Where are you running this code from and where are the labels situated (I assume in the Gallery) ? ThisItem will work if you are running the code from inside the gallery. If not, it will only refer to the first record in the gallery, so will not do what you want.

  • CaN2 Profile Picture
    11 on at

    Thank you @WarrenBelz 

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard