cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Tomorrow, September 18th at 8am PDT

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

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