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 of a Gallery...
Power Apps
Unanswered

Filtering of a Gallery (with a Many to One relationship)

(0) ShareShare
ReportReport
Posted on by 44

Hello,

 

I have a Gallery that the Dataverse tables that populate it has a Many to One relationship and requires filtering.

 

Gallery1 (galProjects) contains a list of projects, and is filterable based on the Dataverse view so no issues there.

Gallery2 (galTasks) contains a list of items that fall under that are associated with that project by project code in the relationship and as such the data source is galProjects.Selected.'Project Items' which produces the list of initial items correctly.

 

However, this list requires filtering based of the values within this Project Items table, specifically a "Task Completed" Yes/No option and a Multiple Selection option for "Initial Check" (With the options Non-Issue, Team 1, Team2, Team 3). The filter would ideally apply so those entries where the Task Completed is set to "Yes" and the Initial Check is set to "Non-Issue" are excluded.

 

While filtering a Gallery directly by these values is not an issue, attempting to filter a gallery with a the above formula data source is just causing errors with whatever I try.

 

Any help would be greatly appreciated.

I have the same question (0)
  • AhmedSalih Profile Picture
    6,678 Moderator on at

    Hello, @CraigPezet, lets try one step at a time and see what error you get:

    Filter(galProjects.Selected.'Project Items', "Task Completed"=TaskCompletedChoice.Yes, Initial Check <> Initial CheckChoice.Non-Issue)

     

     

    Regards,

    Ahmed

    If my reply helped you, please give a 👍. And if it has solved your issue, please consider a 👍 & Accepting it as the Solution to help other members of the community find it more.

    My Blog: www.powerplatformplace.com

  • CraigPezet Profile Picture
    44 on at

    Hi @AhmedSalih,

     

    The first part of this worked as expected but the second part proved to throw up some errors. Most likely as the Initial Check is a multi value combobox field. The current workaround I have is below:

     

    Filter(galProjects.Selected.'Project Items',
    (Toggle1.Value || 'Task Completed'='Task Completed (Project Items)'.No && Not('Initial Check' in NoIssueFilter.SelectedItems))

     

    Where NoIssueFilter was a Input ComboBox with the Items set to Choice('Project Items'.'Initial Check') and the default value set to Last(Choices('Project Items'.'Initial Check')) with it's display mode set to view and then hidden with visibility set to false.

     

    While this does the job, with the filter applied only when the toggle control is set to false, there is still the slight issue that there is a delegation warning as the final filter condition is making use of the in Not and In functions and as such is non-delegatable and being applied in app and ideally I would like it applied in the dataverse to prevent any future issues.

  • Verified answer
    AhmedSalih Profile Picture
    6,678 Moderator on at

    @CraigPezet, try this:

     

    In the Toggle OnChange = ClearCollect('CollectionName',Filter(galProjects.Selected.'Project Items',
    (Toggle1.Value || 'Task Completed'='Task Completed (Project Items)'.No))

     

    Then, Where you have your Filter function, put this: Filter(CollectionName, Not('Initial Check' in NoIssueFilter.SelectedItems))

     

    Regards,

    Ahmed
    If my reply helped you, please give a 👍. And if it has solved your issue, please consider a 👍 & Accepting it as the Solution to help other members of the community find it more.

    My Blog: www.powerplatformplace.com

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard