cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Add a item in a filter dropdown

Hi everyone,

 

I have a question, how can i add an new item in a filter dropdown. here is my code.

Distinct(Filter('PowerApps List';Responsable3 = Title3_8.Text);Responsanble2)

 it give me the result that i want, but the problem is that i don't know how can i add the item "all", also a made a collection code

ClearCollect(SupervisorGroup; {Result: "all"});;
Collect(SupervisorGroup; Distinct('Resultado - Oportunidades'; Responsable2))

 but when i use de collect code i can't filter the results that i want. 

 

I would like to use the first code that i wrote and how can i add a new item.

 

I'm going to waiting for your comments.

 

Best regards.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Add a item in a filter dropdown

Hi @diegoaff92 ,

This code

Distinct(
   Filter(
     'PowerApps List';
     Responsable3 = Title3_8.Text
   );Responsanble2
)

will produce a single column list showing Distinct values of the field Responsanble2 from the List 'PowerApps List' where the field Responsable3 equals the value in the text control Title3_8.

This code

ClearCollect(SupervisorGroup; {Result: "all"});;

will produce a collection SupervisorGroup with one record and one field Result with the value of all

This code

Collect(
   SupervisorGroup; 
   Distinct(
      'Resultado - Oportunidades'; 
      Responsable2
   )
)

 adds to the collection above, but takes the records where a Distinct value exists in 'Resultado - Oportunidadas', but presents the field Responable2 - the same as the first code, but with different criteria. Are you wanting to combine the data sets from these two queries as although they have the same field, the records chosen are different.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Add a item in a filter dropdown

Hi @diegoaff92 ,

You need to do this

ClearCollect(
   SuperGroup1; 
   {Result: "all"}
);;
ClearCollect(
   SuperGroup2;
   Distinct(
      Filter(
         'PowerApps List';
          Responsable3 = Title3_8.Text
      );Responsanble2
   )
);;
ClearCollect(
   SuperGroup3; 
   Distinct(
      'PowerApps List'; 
      Responsable2
   );Responsable2
);;
ClearCollect(
   SupervisorGroup;
   SuperGroup1;
   SuperGroup2;
   SuperGroup3
)

It is however a little strange that the first list is included in the second list.

 

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

5 REPLIES 5
Highlighted
Community Champion
Community Champion

Re: Add a item in a filter dropdown

Hi @diegoaff92 ,

This code

Distinct(
   Filter(
     'PowerApps List';
     Responsable3 = Title3_8.Text
   );Responsanble2
)

will produce a single column list showing Distinct values of the field Responsanble2 from the List 'PowerApps List' where the field Responsable3 equals the value in the text control Title3_8.

This code

ClearCollect(SupervisorGroup; {Result: "all"});;

will produce a collection SupervisorGroup with one record and one field Result with the value of all

This code

Collect(
   SupervisorGroup; 
   Distinct(
      'Resultado - Oportunidades'; 
      Responsable2
   )
)

 adds to the collection above, but takes the records where a Distinct value exists in 'Resultado - Oportunidadas', but presents the field Responable2 - the same as the first code, but with different criteria. Are you wanting to combine the data sets from these two queries as although they have the same field, the records chosen are different.

View solution in original post

Highlighted
Helper III
Helper III

Re: Add a item in a filter dropdown

hi Mr. @WarrenBelz 

 

Thank you for your soon reply. Yes i would like to combine them or create another criteria but using the filtering code.

Distinct(
   Filter(
     'PowerApps List';
     Responsable3 = Title3_8.Text
   );Responsanble2
)

Also i made a mistake, the second code must be.

Collect(
   SupervisorGroup; 
   Distinct(
      'PowerApps List'; 
      Responsable2
   )
)

I'm not sure if can it combine.

 

I'm going to waiting for your comments.

 

Best regards.

 

Highlighted
Community Champion
Community Champion

Re: Add a item in a filter dropdown

Hi @diegoaff92 ,

You need to do this

ClearCollect(
   SuperGroup1; 
   {Result: "all"}
);;
ClearCollect(
   SuperGroup2;
   Distinct(
      Filter(
         'PowerApps List';
          Responsable3 = Title3_8.Text
      );Responsanble2
   )
);;
ClearCollect(
   SuperGroup3; 
   Distinct(
      'PowerApps List'; 
      Responsable2
   );Responsable2
);;
ClearCollect(
   SupervisorGroup;
   SuperGroup1;
   SuperGroup2;
   SuperGroup3
)

It is however a little strange that the first list is included in the second list.

 

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

Highlighted
Microsoft
Microsoft

Re: Add a item in a filter dropdown

Hi @diegoaff92 :

Do you want to add an item to the table:

 

Distinct(Filter('PowerApps List';Responsable3 = Title3_8.Text);Responsanble2)

 

 My method is to convert the result of the first code into a string for processing, and then use the split function to reformat the string into a table. (Strings are easier to handle):

Try this code:

 

Split(
        Concatenate(
            Concat(
                Distinct(Filter('PowerApps List';Responsable3 = Title3_8.Text);Responsanble2);
                Result & "##"
            );/*Integrate the results into a string separated by ##*/
            "all" /*add item all*/
        );
        "##"
    )/*Convert string to table*/

 

Best Regards,

Bof

Highlighted
Helper III
Helper III

Re: Add a item in a filter dropdown

Hi Mr. @WarrenBelz 

It works!

 

Thank you so much, I checked it really closely to understand the big code.

 

Best Regards.

 

Diego Fajardo

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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