cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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
Memorable Member
Memorable Member

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

View solution in original post

2 REPLIES 2
Memorable Member
Memorable Member

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

View solution in original post

It worked! Thank you so much!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,885)