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 a Gallery - Sou...
Power Apps
Answered

Filter a Gallery - Source SharePoint List based on a Collection value

(0) ShareShare
ReportReport
Posted on by

Hi,

 

How to filter SharePoint List based on Collection Value. Only one record will be in the collection. 

I just want to test something. Don't want to use combo box for the filter.

indhaa_0-1679422708280.png

 

Categories:
I have the same question (0)
  • zuurg Profile Picture
    535 Super User 2024 Season 1 on at

    If there will only be 1 record in the collection, you can just use First(collectionname).SourceDestName.

     

    So it would be Filter('Firewall - ...',SourceDestName = First(colFirewallAddressSelected).SourceDestName)

  • indhaa Profile Picture
    on at

    There is a delegation warning. Since the SharePoint list have more records this is not a solution.

     

    indhaa_0-1679489440266.png

     

    Is there a way I can Filter a SharePoint list with a collection record without a delegation warning.

     

  • zuurg Profile Picture
    535 Super User 2024 Season 1 on at

    The delegation warning is from using the First function.  In your original question, you said there would only be 1 record in the collection, so the filtering will work properly.  If there will be more than 1 record in the collection, instead of First, you'll need to use Filter to find the collection's record.

  • indhaa Profile Picture
    on at
    Hi,
     
    There is only one record in the collection but the Filter is used on the SharePoint list and based on the one record in the collection it is retrieving the record from the SharePoint list.
     
    Is there a way I can change the formulae to filter from the SharePoint List for this one record in the collection without getting the delegation error.
  • zuurg Profile Picture
    535 Super User 2024 Season 1 on at

    Can you provide the final filtering code that you ended up using?   Note that the delegation warning (not error) that you're getting is more than likely only applicable to the "first" portion of your query, which again, if the collection only contains the one record, will never be an issue.  For Sharepoint data sources, Filter can be delegated.  First() cannot, but first is being applied to your collection, not the SP list.

  • indhaa Profile Picture
    on at
    Filter(
     'Firewall - Add List',
     SourceDestName = First(colFirewallAddressSelected).SourceDestName)

     

    I need to use a collection for this filter. 

  • Verified answer
    zuurg Profile Picture
    535 Super User 2024 Season 1 on at

    If you absolutely don't want the warning there (again, it won't be an issue with a 1 record Collection), you can always assign your Collection value that you're filtering on to a variable (either local or global) and use that as the filtering value for the SP List.

    So for the screen that your filtering on, for the OnVisible property, add UpdateContext({locSourceDestName: First(colFirewallAddressSelected).SourceDestName })

    Then for your filtering, Filter('Firewall - Add List',SourceDestName = locSourceDestName)

     

  • indhaa Profile Picture
    on at

    Hi,

     

    I'm testing on how I can make SharePoint list available as a drop down on a Combo Box without a delegation.

    That was the code that I was having issue.

     

    Now work as a charm. 

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