cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kosenurm
Helper V
Helper V

If only one option selected in combobox...

Hi there, 

 

I have a combobox which allows users to select one or more items. Let's say these items are "Apples", "Pears", "Bananas". 

 

On a button control, I have it set to patch whatever has been selected by the user to the Dataverse table.

 

However, I want to restrict it so that the user cannot ONLY select "Bananas"; they either must have "Bananas" plus another item or not select "Bananas" at all, in order for the patch command to operate and navigate to the next screen. 

 

Any ideas?


Thanks


K.

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

You can put the code below on the DispalyMode:

If(ComboBox3.Selected.Value="Bananas" && CountRows(ComboBox3.SelectedItems.Value)=1,
DisplayMode.Disabled,DisplayMode.Edit)

 

Or Notify OnSelect:

If(ComboBox3.Selected.Value="Bananas" && CountRows(ComboBox3.SelectedItems.Value)=1,
 Notify("Please List should not have only Bananas"))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Please Subscribe to my Youtube Channel

 

View solution in original post

1 REPLY 1
eka24
Super User
Super User

You can put the code below on the DispalyMode:

If(ComboBox3.Selected.Value="Bananas" && CountRows(ComboBox3.SelectedItems.Value)=1,
DisplayMode.Disabled,DisplayMode.Edit)

 

Or Notify OnSelect:

If(ComboBox3.Selected.Value="Bananas" && CountRows(ComboBox3.SelectedItems.Value)=1,
 Notify("Please List should not have only Bananas"))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Please Subscribe to my Youtube Channel

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,326)