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 / Filtering gallery data...
Power Apps
Answered

Filtering gallery data based on user selection with a few conditions

(0) ShareShare
ReportReport
Posted on by 85

Carrying on with my previous post about the PowerApp I am building.

I have a SharePoint list called 'Teachers'.

In that list there's a column called 'Subjects'.

Subject column is of type drop down and has eights subjects in it and has multi select option enabled.

I have placed it on a screen called 'Teacher profile' in my PowerApps application.

Every teacher must select two subjects from the drop down(min and max is 2) and they can have min 3 students under him/her/they and maximum of 5(this option is in a different drop down selection). Once 5 has been reached, they will not be able to take a new student.

I have a new screen in which the students will be able to view all the teachers that are available and they should be able to filter that list based on the subjects(can be a multi subject filter or a single subject filter).

I am trying to implement this and have two approaches in mind.

1. Build a new screen which will have individual buttons for the subjects and clicking on which, the student is taken to the new screen where the gallery is updated showing the teachers' data who teach that subject/subjects. 

How do I implement this? How do I pick up the value from the button and then populate the gallery on the new screen for the selected data? How do I compare and search the 'Teachers' SharePoint list and update the gallery data for single and multi select?

2. Build only one screen and put the subjects in a combo box and then put a gallery on the same screen and this will filter the gallery data based on the dropdown value/s selected by the students.

How do I filter the gallery data based on the selection when the students select more than one subject/multiple subjects?

 

Categories:
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @AD1990,

    Do you want to filter the teachers based on the multi subjects selected?

    Could you please tell me that if the Teacher column is a Person column or not?

     

    I have a test on my side, please take a try as below. Just assume that the Teacher column is a Person type.

    Add a Combo Box to select multi Subjects and set the Items property as below:

    Choices(Teachers.Subjects)

    Set the Items property of the Gallery as below:

    Filter(
     Teachers,
     CountRows(
     Filter(
     ForAll(
     Subjects.Value,
     If(
     Value in ComboBox1.SelectedItems.Value,
     {t: 1},
     {t: 0}
     )
     ),
     t = 1
     )
     ) >= CountRows(ComboBox1.SelectedItems.Value)
    )

    vqiaqimsft_0-1636702143126.png

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard