cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AntonioHAC
Level: Powered On

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 @AntonioHAC ,

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' and 'Thumbs Up' those who deserve it!
AntonioHAC
Level: Powered On

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' and 'Thumbs Up' those who deserve it!
Community Support Team
Community Support Team

Re: Button to set DropDown

HI @AntonioHAC ,

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 63 members 3,477 guests
Please welcome our newest community members: