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

Problem with filter a gallery with an allowemtpysection

Hi everyone,

I have a problem when i filter a gallery. I'm going to show you my codes and how i can fixe the problem.

 

Screen1. Porperty: OnVisible

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

The "SupervisorGroup" It's placed in a "dropdown1"

Gallery. Property: Items

Filter(
    'Powerapp List - Ventas';
    Responsable3 = VarUser.Email;
    If(Dropdown1.Selected.Result = "Todo";
    true;
    Responsable2 = Dropdown1.Selected.Result
);
If(Dropdown1_2.Selected.Value = "Todo";
true;
E = Dropdown1_2.Selected.Value
);
If(Dropdown1_1.Selected.Value = "Todo";
true;
TP = Dropdown1_1.Selected.Value
);
If(Dropdown1_9.Selected.Responsanble = "";
true;
Responsable = Dropdown1_9.Selected.Responsanble)
)

Dropdown1_9. Property: Items

Filter('PowerApps List'; Responsable2 = Dropdown1.Selected.Result)

Here it's the problem. When I filter in the "dropdown1", "Todo", the dropdown1_9 gets empty and doesn't filter anything, but when I filter a name in the "dropdown1", the "dropdowm1_9" give me the result and filter the gallery.

 

second pic.pngfirstpic.png

 

Please help me how can i fix this problem, I would like to filter "Todo", and show me all the items in the gallery.

 

I'm going to waiting for your comments.

 

Best regards

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Problem with filter a gallery with an allowemtpysection

Hi @diegoaff92 ,

Based on the issue that you mentioned, I think this issue is related to the Items property formula of your second Dropdown box (ESPECIALISTA). I agree with @WarrenBelz 's thought almost.

 

But if you Dropdown control to act as the Dropdown box to list your ESPECIALISTA options, it would use the first record from the table as default value within the Dropdown box rather than Blank value.

 

You could consider remove the second Dropdown control, instead, add a ComboBox control to list your ESPECIALISTA options. Then set the Items property of the ComboBox (rename it "EspecialistaComboBox") to following:

Filter(
        'PowerApps List';
         If(
            Dropdown1.Selected.Result = "Todo";
            true;
            Responsable2 = Dropdown1.Selected.Result
         )
)

set the SelectMultiple property of the ComboBox to following:

false

specify "Responsanble" column value as Primary Text and Search Field within this ComboBox.

 

After that, modify your Gallery Items property as below:

Filter(
    'Powerapp List - Ventas';
    Responsable3 = VarUser.Email;
    If(
       Dropdown1.Selected.Result = "Todo";
       true;
       Responsable2 = Dropdown1.Selected.Result
    );
    If(
       Dropdown1_2.Selected.Value = "Todo";
       true;
       E = Dropdown1_2.Selected.Value
    );
    If(
       Dropdown1_1.Selected.Value = "Todo";
       true;
       TP = Dropdown1_1.Selected.Value
    );
    If(
       IsBlank(EspecialistaComboBox.Selected.Responsanble);    // Modify formula here
       true;
       Responsable = EspecialistaComboBox.Selected.Responsanble   // Modify formula here
    )
)

 

Please consider take a try with above solution, then 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.

View solution in original post

5 REPLIES 5
Highlighted
Community Champion
Community Champion

Re: Problem with filter a gallery with an allowemtpysection

Hi @diegoaff92 ,

Working through this, your Dropdown1 Items are from this collection

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

as an aside, you could do this simpler with 

ClearCollect(
   SupervisorGroup; 
   {Result: "Todo"}
);;
Collect(
   SupervisorGroup;
   Distinct(
      Filter(
         'PowerApps List';
         Responsable3 = Title3_8.Text
      );
      Responsanble2
   )
)

 so you have a Distinct list from the data source 'PowerApps List' of the field Responsanble2 where Responsable3 = Title3_8.Text.

Your other drop-down Dropdown1_9 has the Items

Filter(
   'PowerApps List'; 
   Responsable2 = Dropdown1.Selected.Result
)

which is a Table of all records where Responsable2 equals what is selected in the first drop-down. You have not said what field you are displaying in the list from this record, but that is probably not relevant.

Now your Gallery Filter - the relevant part is this

If(
   Dropdown1.Selected.Result = "Todo";
   true;
   Responsable2 = Dropdown1.Selected.Result
)

You are saying if Todo is selected, ignore the selection (do not use the filter, just the ones below), but if something else is selected, use that value to filter the list (as well as the other filters below). I am assuming that Todo does not produce any matching results from the list? If so, that explains why you are getting nothing in your second filter. Do you need the second filter Items based on the result of the first - I am assuming you are using another field from the List and filtering on this?

 

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.

Highlighted
Helper III
Helper III

Re: Problem with filter a gallery with an allowemtpysection

Hi Mr. @WarrenBelz,

Thank you for your soon reply.

 

Yes, I would like that my secod filter will based on the first item, because, as I showed in the pics, the gallery works only if I filter the first one with the next value, "diego.fajardo@prosegur.com"; "diana.mendoza@prosegur.com" and the second filter give me the results of both items, but when I put "Todo" in the first item the gallery doesn't give me the results.

 

I'm going to waiting for your comments.

Best regards.

Diego Fajardo.

 

 

Highlighted
Community Champion
Community Champion

Re: Problem with filter a gallery with an allowemtpysection

Hi @diegoaff92 ,

I think I gave you the answer - if Todo returns no results, you will get no items in the drop-down - is this the case?

You could try this on you second drop-down

Filter(
   'PowerApps List';
   If(
      Dropdown1.Selected.Result="Todo";
      true;
      Responsable2 = Dropdown1.Selected.Result
   )
)

 

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.

Highlighted
Community Champion
Community Champion

Re: Problem with filter a gallery with an allowemtpysection

Hi @diegoaff92 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Highlighted
Community Support
Community Support

Re: Problem with filter a gallery with an allowemtpysection

Hi @diegoaff92 ,

Based on the issue that you mentioned, I think this issue is related to the Items property formula of your second Dropdown box (ESPECIALISTA). I agree with @WarrenBelz 's thought almost.

 

But if you Dropdown control to act as the Dropdown box to list your ESPECIALISTA options, it would use the first record from the table as default value within the Dropdown box rather than Blank value.

 

You could consider remove the second Dropdown control, instead, add a ComboBox control to list your ESPECIALISTA options. Then set the Items property of the ComboBox (rename it "EspecialistaComboBox") to following:

Filter(
        'PowerApps List';
         If(
            Dropdown1.Selected.Result = "Todo";
            true;
            Responsable2 = Dropdown1.Selected.Result
         )
)

set the SelectMultiple property of the ComboBox to following:

false

specify "Responsanble" column value as Primary Text and Search Field within this ComboBox.

 

After that, modify your Gallery Items property as below:

Filter(
    'Powerapp List - Ventas';
    Responsable3 = VarUser.Email;
    If(
       Dropdown1.Selected.Result = "Todo";
       true;
       Responsable2 = Dropdown1.Selected.Result
    );
    If(
       Dropdown1_2.Selected.Value = "Todo";
       true;
       E = Dropdown1_2.Selected.Value
    );
    If(
       Dropdown1_1.Selected.Value = "Todo";
       true;
       TP = Dropdown1_1.Selected.Value
    );
    If(
       IsBlank(EspecialistaComboBox.Selected.Responsanble);    // Modify formula here
       true;
       Responsable = EspecialistaComboBox.Selected.Responsanble   // Modify formula here
    )
)

 

Please consider take a try with above solution, then 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.

View solution in original post

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 (6,683)