cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Button to set DropDown

Hi guys,

 

I need to create a button to set the DropDowns to "* All".

 

I need when I click the button, change the state of the filter for everyone.

 

I tried to do with the UpdateContext function, but I did not succeed. It does not show any errors, but also does not change the state of the dropdown Default to "* All".

 

PS: I'm using the "Sort (EstDia, Result)" function as dropdown Items. Is this a problem when filtering with button?

 

Does anyone else know how to do this?

 

 

filter.png

 

Thank all,

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Button to set DropDown

HI @Anonymous ,

Do you want to change the values within all Dropdown controls into "* All" when you click the Button within your app?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

1. If the Dropdowns that you mentioned is the Dropdown control in PowerApps:

Set the OnSelect property of the Button to following:

 

Set(IsClicked, !IsClicked)

 

Set the Default property of the DropdownLetra to following:

 

If(
   IsClicked,
   "* All"
)

Set the Default property of the DropdownMes to following:

If(
   IsClicked,
   "* All"
)

Set the Default property of the DropdownDia to following:

If(
   IsClicked,
   "* All"
)

Set the Default property of the DropdownAno to following:

If(
   IsClicked,
   "* All"
)

 

2. If the Dropdowns that you mentioned is the ComboBox control in PowerApps:

Set the OnSelect property of the Button to following:

Set(IsClicked, !IsClicked)

Set the DefaultSelectedItems property of the DropdownLetra to following:

If(
IsClicked,
{Result: "* All"}
)

Set the DefaultSelectedItems property of the DropdownMes to following:

If(
IsClicked,
{Result: "* All"}
)

Set the DefaultSelectedItems property of the DropdownDia to following:

If(
IsClicked,
{Result: "* All"}
)

Set the DefaultSelectedItems property of the DropdownAno to following:

If(
IsClicked,
{Result: "* All"}
)

 

Please 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

4 REPLIES 4
Super User
Super User

Re: Button to set DropDown

Are you setting Default or DefaultSelectedItems with your button? (and is there a value called "* All" in the list of items)




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
Highlighted
Anonymous
Not applicable

Re: Button to set DropDown

Filtering Sharepoint list for dropdowns

   ClearCollect(EstatisticaProduto,
        Filter(OPA_3,
    Celula = RadioEstatistica.Selected.Value || Area = RadioEstatistica.Selected.Value || Setor = RadioEstatistica.Selected.Value));


ClearCollect(EstLetra,
Distinct(EstatisticaProduto,Letra));
Collect(EstLetra,{Result:"* All"});

ClearCollect(EstMes,
Distinct(EstatisticaProduto, Mes));
Collect(EstMes,{Result:"* All"});

ClearCollect(EstDia,
Distinct(EstatisticaProduto, Dia));
Collect(EstDia,{Result:"* All"});

ClearCollect(EstAno,
Distinct(EstatisticaProduto, Ano));
Collect(EstAno,{Result:"* All"});


Icon filter

ClearCollect(
FilterDropdown,
Filter(EstatisticaProduto,
Letra = DropdownLetra.Selected.Result || DropdownLetra.Selected.Result = "* All",
Mes = DropdownMes.Selected.Result || DropdownMes.Selected.Result = "* All",
Dia = DropdownDia.Selected.Result || DropdownDia.Selected.Result = "* All",
Ano = DropdownAno.Selected.Result || DropdownAno.Selected.Result = "* All"
));


I need when I click the button, the Dropdowns values change to "* All".

For instance, DropdownDia (Items)

Sort(EstDia,Result)



Super User
Super User

Re: Button to set DropDown

Ok,

 

For your Dropdowns:

 

For your EstLetra (DefaultSelectedItems) have a variable:

EstLetraDefaultItem

 

For your EstMes (DefaultSelectedItems) have a variable:

EstMesDefaultItem

 

For your EstDia (DefaultSelectedItems) have a variable:

EstDiaDefaultItem

 

For your EstAno (DefaultSelectedItems) have a variable:

EstAnoDefaultItem

 

Then have your button (OnSelect😞

Set(EstLetraDefaultItem, "* All");

Set(EstMesDefaultItem, "* All");

Set(EstDiaDefaultItem, "* All");

Set(EstAnoDefaultItem, "* All")

 

You should not need to change your (Items) on any of the dropdowns - let me know if you run into any issues with this,

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
Community Support Team
Community Support Team

Re: Button to set DropDown

HI @Anonymous ,

Do you want to change the values within all Dropdown controls into "* All" when you click the Button within your app?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

1. If the Dropdowns that you mentioned is the Dropdown control in PowerApps:

Set the OnSelect property of the Button to following:

 

Set(IsClicked, !IsClicked)

 

Set the Default property of the DropdownLetra to following:

 

If(
   IsClicked,
   "* All"
)

Set the Default property of the DropdownMes to following:

If(
   IsClicked,
   "* All"
)

Set the Default property of the DropdownDia to following:

If(
   IsClicked,
   "* All"
)

Set the Default property of the DropdownAno to following:

If(
   IsClicked,
   "* All"
)

 

2. If the Dropdowns that you mentioned is the ComboBox control in PowerApps:

Set the OnSelect property of the Button to following:

Set(IsClicked, !IsClicked)

Set the DefaultSelectedItems property of the DropdownLetra to following:

If(
IsClicked,
{Result: "* All"}
)

Set the DefaultSelectedItems property of the DropdownMes to following:

If(
IsClicked,
{Result: "* All"}
)

Set the DefaultSelectedItems property of the DropdownDia to following:

If(
IsClicked,
{Result: "* All"}
)

Set the DefaultSelectedItems property of the DropdownAno to following:

If(
IsClicked,
{Result: "* All"}
)

 

Please 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
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 (Last 30 Days)
Users online (4,742)