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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combo box to filter Sh...
Power Apps
Answered

Combo box to filter SharePoint list and a collection?

(0) ShareShare
ReportReport
Posted on by 68

I am trying to filter a SharePoint data source column of items using both another column in the SharePoint list of email addresses and a collection (derived from a different SharePoint list) of only the email addresses from that list.

 

This works:

Filter('SPList1', StartsWith('Title',DataCardEmail.Text))

 

I would also like to include a collection, lets call it colSPList2Email as part of this filter. Can this be done?

 

For clarity:
SPList1 has 2 columns. Title (items) + Email (addresses)

SPList2 has 1 column of Email address and colSPList2Email collects this when the app loads.
DataCardEmail contains the current users email address that is using the form. 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @CrimsonCrayon 

    Is this an Or condition for both lists or does the email need to be in both lists.

  • CrimsonCrayon Profile Picture
    68 on at

    It would in an Or condition. If the user exists in either of the 2 lists, I want them to see the item.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @CrimsonCrayon 

     

     

    !IsBlank(LookUp('SPList1', StartsWith('Title',DataCardEmail.Text)) ||
    !IsBlank(LookUp(colSPList2Email,emailcolumnname=User.Email))
    

     

     

    for the visible property of the item.  Replace emailcolumnname with the actual name of the email column in the collection.   

  • CrimsonCrayon Profile Picture
    68 on at

    Is your solution here to make the combo box invisible if their email address is not in either list?

     

    I currently I have a condition in the Visible property based on a previous input item. I think your code above may have been missing a ) at the end of the first statement before the || 

     

    I could not get the collection working so I decided to just try pulling directly from SPList2 and this is what I have come up with:

     

    If(DataCardValue2.Selected.Value = "Request Type 2",true,false) 
    &&
    !IsBlank(LookUp('SPList1', StartsWith('Title',DataCardEmail.Text))) ||
    !IsBlank(LookUp('SPList2', StartsWith('Title',DataCardEmail.Text)))

     

    Is this what you are suggesting?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @CrimsonCrayon 

    Please try to get your head around the concept that you don't need to use an If(.. function in a visible property when the elements of the formula are already either true or false.  It just complicates it. 

     

    DataCardValue2.Selected.Value = "Request Type 2"&& 
    !IsBlank(LookUp('SPList1', StartsWith('Title',DataCardEmail.Text)) ||
    !IsBlank(LookUp('SPList2', StartsWith('Title',DataCardEmail.Text))

     

  • Verified answer
    CrimsonCrayon Profile Picture
    68 on at

    In the end this worked for me:

    If(
    CountIf(colGlobalWL, "Title" = varUserEmail)=1,
     Filter('SPList1', StartsWith(LocalWL, varUserEmail),"Title", Ascending),
     SortByColumns('SPList1', "Title", Ascending)
    )

     

    colGlobalWL is a collection of email addresses pulled from SPList2. It represents people that should be able to see the entire SPList1 items. If they are not in this list then SPList1 gets filtered using the LocalWL column in SPList1. Unfortunately this column is a multiline text column so it results in a delegation warning still.

  • CrimsonCrayon Profile Picture
    68 on at

    Thank you for helping me realize this concept and for taking the time to try to help me out here...

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @CrimsonCrayon 

    Unfortunately, "in" is not delegated in SharePoint.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard