cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

two filters or more, one gallery (RADIO, TEXT FILTER AND TOGGLE)

Hey guys, I have a Gallery with radio, toggle and text filter, but I cannot use two radio and toggle at the same time.

 

There is my code: 

If(
    Radio1_1.Selected.Value = "Maior";
    Sort(
        collTaskListForGallery;
        TrabalhoPercentualdaTarefaConcluído;
        Descending
    );
    Radio1_1.Selected.Value = "Menor";
    Sort(
        collTaskListForGallery;
        TrabalhoPercentualdaTarefaConcluído;
        Ascending
    );
    Radio1.Selected.Value = "Maior";
    Sort(
        collTaskListForGallery;
        OrdemdeManutenção;
        Descending
    );
    Radio1.Selected.Value = "Menor";
    Sort(
        collTaskListForGallery;
        OrdemdeManutenção;
        Ascending
    );
    toggle_porcentagem.Value = true;
    Sort(
        collTaskListForGallery;
        TrabalhoPercentualdaTarefaConcluído;
        Ascending
    );
    toggle_porcentagem.Value = false;
    Sort(
        collTaskListForGallery;
        TrabalhoPercentualdaTarefaConcluído;
        Descending
    );
    drpFilter.Selected.Value = "Data início";
            Filter(collTaskListForGallery;DateTimeValue("01/01/1970 00:00:00"); DatadeInícioRealdaTarefa; ShortDate= Text(
                DatePicker1.SelectedDate;
                DateTimeFormat.ShortDate)
            );
    toggle_porcentagem.Value = false;
    collTaskListForGallery
)

 

I just need to use the TOGGLE and the RADIO at the same time.

 

If can one help me out...

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: two filters or more, one gallery (RADIO, TEXT FILTER AND TOGGLE)

@Gorilla_8 ,

You have combined Sort and Filter in the one If statement - you cannot do this as they are two separate functions.

The code below is ONLY to show you the structure required. I will leave you to tidy up any issues with values, brackets,  semicolons and valid data. You do not need the second reference to the gallery as the true/false on toggle_porcentagem.Value is irrelevant.

Sort(
      If(
         drpFilter.Selected.Value = "Data início";
         Filter(
            collTaskListForGallery;                                    
            DateTimeValue("01/01/1970 00:00:00"); 
            DatadeInícioRealdaTarefa; 
            ShortDate= Text(
               DatePicker1.SelectedDate;
               DateTimeFormat.ShortDate
         );
         collTaskListForGallery
      );
      If(
         Radio1_1.Selected.Value = "Maior";
         TrabalhoPercentualdaTarefaConcluído;
         Descending;
         Radio1_1.Selected.Value = "Menor";
         TrabalhoPercentualdaTarefaConcluído;
         Ascending;
         Radio1.Selected.Value = "Maior";
         OrdemdeManutenção;
         Descending;
         Radio1.Selected.Value = "Menor";
         OrdemdeManutenção;
         Ascending;
         toggle_porcentagem.Value = true;
         TrabalhoPercentualdaTarefaConcluído;
         Ascending;
         TrabalhoPercentualdaTarefaConcluído;
         Descending
      )
   )
)

 

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

3 REPLIES 3
Highlighted
Community Champion
Community Champion

Re: two filters or more, one gallery (RADIO, TEXT FILTER AND TOGGLE)

@Gorilla_8 ,

Where are you getting the error and what does it say?

Highlighted
Post Prodigy
Post Prodigy

Re: two filters or more, one gallery (RADIO, TEXT FILTER AND TOGGLE)

@WarrenBelz Thanks for the reply! 

It's not getting an error, but when I select on the radio and another radio didn't work together...

 

Unfortanelly...

Highlighted
Community Champion
Community Champion

Re: two filters or more, one gallery (RADIO, TEXT FILTER AND TOGGLE)

@Gorilla_8 ,

You have combined Sort and Filter in the one If statement - you cannot do this as they are two separate functions.

The code below is ONLY to show you the structure required. I will leave you to tidy up any issues with values, brackets,  semicolons and valid data. You do not need the second reference to the gallery as the true/false on toggle_porcentagem.Value is irrelevant.

Sort(
      If(
         drpFilter.Selected.Value = "Data início";
         Filter(
            collTaskListForGallery;                                    
            DateTimeValue("01/01/1970 00:00:00"); 
            DatadeInícioRealdaTarefa; 
            ShortDate= Text(
               DatePicker1.SelectedDate;
               DateTimeFormat.ShortDate
         );
         collTaskListForGallery
      );
      If(
         Radio1_1.Selected.Value = "Maior";
         TrabalhoPercentualdaTarefaConcluído;
         Descending;
         Radio1_1.Selected.Value = "Menor";
         TrabalhoPercentualdaTarefaConcluído;
         Ascending;
         Radio1.Selected.Value = "Maior";
         OrdemdeManutenção;
         Descending;
         Radio1.Selected.Value = "Menor";
         OrdemdeManutenção;
         Ascending;
         toggle_porcentagem.Value = true;
         TrabalhoPercentualdaTarefaConcluído;
         Ascending;
         TrabalhoPercentualdaTarefaConcluído;
         Descending
      )
   )
)

 

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

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

Top Solution Authors
Top Kudoed Authors
Users online (10,012)