cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Vitorino07
Level: Power Up

Columns filter in gallery

Hello, I need the user to be able to select which column to display and in this column only fields containing "NR 12" are displayed, is there any way? I tried to perform the following functions: SortByColumns (Table2; Dropdown1.Selected.Value) in the gallery, but couldn't filter the "NR 12" values, and the one in the image, would work if I made a screen for each column, but I I find it unfeasible.

App.jpgline of cod in my gallery

 

Table.jpgtable

 

1 REPLY 1
Community Support Team
Community Support Team

Re: Columns filter in gallery

Hi @Vitorino07 ,

Do you list your available filter columns of your data source within a Dropdown box?

Do you want to filter your Gallery Items based on the selected column within the Dropdown box?

 

If you want to filter your Gallery Items based on dynamic column selection, I afraid that there is no way to achieve your needs in PowerApps currently.

The third argument of the Search function is required to provide a actual column name, but the Dropdown1.Selected.Value would return a Text value, which could not be recognized as a Column name automatically.

 

As an alternative solution, I think If function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Gallery to following:

If(
      Dropdown1.Selected.Value = "FORNO";
      Search(Table2; "Habilitado NR 12"; "FORNO");   /* <-- "FORNO" here is a Column name from your Table2 */
      Dropdown1.Selected.Value = "BOSCH";
      Search(Table2; "Habilitado NR 12"; "BOSCH");     /* <-- "BOSCH" here is a column name from your Table2 */
      Dropdown1.Selected.Value = "TCM";
      Search(Table2; "Habilitado NR 12"; "TCM");       /* <--  "TCM" here is a column name from your Table2 */
      ...
)

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 313 members 5,005 guests
Please welcome our newest community members: