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 / Filter Gallery based o...
Power Apps
Answered

Filter Gallery based on dropdown selection

(0) ShareShare
ReportReport
Posted on by 90

Hi,

 

I have a gallery ('HR01Gallery') pulling through SharePoint list data from a list named 'HR01'. This list contains a column named 'Form Status'. 

 

I have a dropdown list ('FormStatusDropdown') which connects to 'HR01' and displays the Value of the 'Form Status' column. The values in this column are either 'Submitted', 'Approved', or 'Rejected'.   

 

I'd like to be able to change the gallery items displayed based on the dropdown item selected. For example, if I select 'Approved' in the dropdown, the gallery only shows those records with a 'Form Status' of 'Approved'.

 

Can someone please kindly point me in the right direction? 

 

Thanks

 

 

Capture.JPG
Categories:
  • cds Profile Picture
    1,001 on at

    Filter(HR01, 'Form Status' = Dropdown.selected.value)

  • DisappointmentB Profile Picture
    61 on at

    Hello,

     

    You can do this in a number of ways. One method is to use a Switch on the Items for the Gallery based on the Value of the drop down. Within each case statement you can create a filter formula that uses the Value. Another way is to simply create a filter statement in the items for the gallery that use the Value of the dropdown. e.g. Within the Filter put ddApprovedDropdown.Selected.Value

     

    Hope this helps

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Tricky778

     

    If 'Form Status' column is choices type, please try this:

     

    Filter(HR01, 'Form Status'.Value=FormStatusDropdown.Selected.Value)

     

     

    Best regards,

    Sik

    —————————————————————

    If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

  • Tricky778 Profile Picture
    90 on at

    Thanks @cds, but this doesn't seem to work, I perhaps should have mentioned that the column in SharePoint for 'Form Status' is a text field. At present it doesn't like the '=' or '.value' (see image attached). 

    Capture.JPG
  • cds Profile Picture
    1,001 on at

    well take off the .value and see what the intellisense suggests. 

     

     

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Tricky778 ,

     

    Could you share the items property of dropdown?

    We can't give you the accurate expression, because it is up to the Items property of dropdown.

    From my experience, there are about three possibilities: Dropdown.selected.Value , Dropdown.selected.Result or Dropdown.selected.'Form Status'. You can take a try.

    Also I suggest you to type a " . " dot after 'Dropdown.selected' and try any autocomplete suggestion that appears.

     

    Hope this helps.

    Best regards,

    Sik

    —————————————————————

    If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

  • Tricky778 Profile Picture
    90 on at

    Thanks Sik,

     

    I used your guidance to come up with the string below which had the desired results:

     

    Filter(HR01, 'Form Status'= FormStatusDropdown.Selected.'Form Status')

     

    👍

  • Jim_4469786f6e Profile Picture
    13 on at

    Hi All!

    I have a slightly different use case. Instead of filtering based on the status of a drop down, I need to filter the view based on the already set value for the field, per user. So I use a flow to email a link to a responsible pers per department fed from a sharepoint list, the link is to a gallery displaying data from a second list. One of the columns is Department_Name, and the gallery has the below filter to only show the line items with the same department as the authenticated person opening the link:

    Filter('datasource',DEPARTMENT_NAME=Office365Users.MyProfile().Department)

    Now this works just fine if the department_name field is a text input box, but of course we don't want people to invent departments, or otherwise mistype one, we need this to be a drop down of fixed values, one per user. We do want to let the responsible pers redirect a relocated user to another department, hence the ability to edit this field.

    I have tried a number of ways to make this work but its consistently not filtering the display based on the user's department with a drop-down like it will with a text input. It consistently displays no line items 🙂

     

    Any help would be greatly appreciated!

     

    And if your feeling really helpful, the next problem is how to make pers with no department set to see nothing, not everything, as happens when using a text input box and it comes up.

     

    Thank you!!

  • Jim_4469786f6e Profile Picture
    13 on at

    It would seem like this should work (items prop of the to be filtered gallery)

    Filter(Choices([@'datasource'].DEPARTMENT_NAME),(Value=Office365Users.MyProfile().Department))

    It shows no errors but fails to return any data when used. It seems that I need to pre-cache the value returned from AAD, but I am not sure how to do that (new with powerapps)

    I am just going to work around this for the moment so I can make it work and carry on, but if anyone has an answer to this, please provide so I can clean this part up. Thank you!

  • ha_wai Profile Picture
    104 on at

    Although this thread is rather old, @v-siky-msft I do officially declare you my hero of the day!

    I was desperately trying to find out why I got thrown an incompatible data type error for about 3 hours.

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