cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Need some help Merging Gallery filters.

Hello Everyone,

 

I'm struggling to merge three formulas that i'm using to filter a Gallery. 

For now i'm using three different gallery , using the same list called :  ListeMatriceCompetences 

Each gallery as its own filter and i'm trying to merge all of them (Filters) in the same gallery.

 

My Filters :

 

SortByColumns(Filter([@ListeMatriceCompetences];StartsWith(Categorie;Recherche_Categorie.Text));"Categorie";If(SortDescendingCategorie;Descending;Ascending)) 

Wich is used to sort items by the column : Categorie

 

SortByColumns(Filter([@ListeMatriceCompetences];StartsWith(Competence;Recherche_Competence_2.Text));"Competence";If(SortDescendingCompetence;Descending;Ascending))

Wich is used to sort items by the column : Competence

 

Filter([@ListeMatriceCompetences]; Lower(Collaborateur.Email)=Lower(User().Email))

Wich is used to only show current records onthe list for the user using the App, column name is : Collaborateur (person or group column type)

 

I would like to merge the 3 formulas into one only, can someone help me ?

 

Thanks .

 

Best regards.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @Remydio <

I will give you the filter bit, but you have a conundrum with the sort (the below is valid, but not effective) 

SortByColumns(
   Filter(
      [@ListeMatriceCompetences];
      StartsWith(Categorie;Recherche_Categorie.Text) &&
      StartsWith(Competence;Recherche_Competence_2.Text) &&
      Lower(Collaborateur.Email)=Lower(User().Email)
   );
   "Categorie";
   If(
      SortDescendingCategorie;
      Descending;
      Ascending
   );
   "Competence";
   If(
      SortDescendingCompetence;
      Descending;
      Ascending
   )
) 

You have to decide what you want to sort on - not an issue if you had SortCategorie (COmpetence would be the alternative)- then it would be

SortByColumns(
   Filter(
      [@ListeMatriceCompetences];
      StartsWith(Categorie;Recherche_Categorie.Text) &&
      StartsWith(Competence;Recherche_Competence_2.Text) &&
      Lower(Collaborateur.Email)=Lower(User().Email)
   );
   If(
      SortCategorie;
      "Categorie"   
      "Competence"
   )
) 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

2 REPLIES 2
Super User III
Super User III

Hi @Remydio <

I will give you the filter bit, but you have a conundrum with the sort (the below is valid, but not effective) 

SortByColumns(
   Filter(
      [@ListeMatriceCompetences];
      StartsWith(Categorie;Recherche_Categorie.Text) &&
      StartsWith(Competence;Recherche_Competence_2.Text) &&
      Lower(Collaborateur.Email)=Lower(User().Email)
   );
   "Categorie";
   If(
      SortDescendingCategorie;
      Descending;
      Ascending
   );
   "Competence";
   If(
      SortDescendingCompetence;
      Descending;
      Ascending
   )
) 

You have to decide what you want to sort on - not an issue if you had SortCategorie (COmpetence would be the alternative)- then it would be

SortByColumns(
   Filter(
      [@ListeMatriceCompetences];
      StartsWith(Categorie;Recherche_Categorie.Text) &&
      StartsWith(Competence;Recherche_Competence_2.Text) &&
      Lower(Collaborateur.Email)=Lower(User().Email)
   );
   If(
      SortCategorie;
      "Categorie"   
      "Competence"
   )
) 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Hello WarrenBelz,

 

That solved my issue, thanks a lot !

I now understand how to merge these formulas filters and will be able to reproduce by myself. Much appreciated !

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,185)