cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shelley
Level: Power Up

Button visibility with multiple value choice field

Hello,

I'm new to powerapps and having some difficulty with this one thing.

 

I want to make specific buttons visible based on the corresponding selection in a dropdown field that allows for multiple selections. What I have so far is:

 

Button1.Visible=If(DataCardValue11.Selected.Value in "1", true)

Button2.Visible=If(DataCardValue11.Selected.Value in "2", true)

 

And it works, however it won't keep all buttons visible if another selection in the dropdown is made. So if I choose 1 from the dropdown, Button1 is visible. If I want to add 2 to my selections, Button1 disappears, and Button2 is visible.

 

Any help would be greatly appreciated.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
tchin-nin
Level 10

Re: Button visibility with multiple value choice field

Hi @Shelley

 

So you have a Combobox allowing multiple selections, right ? 

To check if an item is in the multiple selected item you need to use the SelectedItems property, so basically, with the sample data, "1", "2", "3",... are stored in the Value2 property. Your formula on the visible property of your button looks like :

 

"1" in Combobox1.SelectedItems.Value2

"2" in Combobox1.SelectedItems.Value2

 

You can see that I'm not using a If() function. The result of a condition is a boolean (true or false), and the Visible property expects a boolean, so no need to use "If(condition,true,false)" you can directly use "condition".

 

Théo

2 REPLIES 2
tchin-nin
Level 10

Re: Button visibility with multiple value choice field

Hi @Shelley

 

So you have a Combobox allowing multiple selections, right ? 

To check if an item is in the multiple selected item you need to use the SelectedItems property, so basically, with the sample data, "1", "2", "3",... are stored in the Value2 property. Your formula on the visible property of your button looks like :

 

"1" in Combobox1.SelectedItems.Value2

"2" in Combobox1.SelectedItems.Value2

 

You can see that I'm not using a If() function. The result of a condition is a boolean (true or false), and the Visible property expects a boolean, so no need to use "If(condition,true,false)" you can directly use "condition".

 

Théo

Shelley
Level: Power Up

Re: Button visibility with multiple value choice field

It worked! Thank you so much!