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

Combo box disable/enable

Hi Guys,
Does anyone know how to execute the formula on this I have 5 combo box If all combo boxes are empty/Find Items the button will still disabled until item selected
combobox.PNG

3 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Combo box disable/enable

@Big_S 

 

You can update the DisplayMode property of your button as:
 
If(CountRows(ComboBox1.SelectedItems) > 0 && CountRows(ComboBox2.SelectedItems) > 0 && CountRows(ComboBox3.SelectedItems) > 0 && CountRows(ComboBox1_1.SelectedItems) > 0 && CountRows(ComboBox2_1.SelectedItems) > 0, Edit,Disabled)
MicrosoftTeams-image (163).png

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Big_S
Level: Powered On

Re: Combo box disable/enable

Hi @yashag2255 

 

IT Works, however, I have 1 textbox also with same functionalities what I did is this but it's not working where did I get wrong?
If(!IsBlank(AmountTxtInput.Text) &&If(Value(AmountTxtInput.Text) >= 1, true),Edit,Disabled) & If(CountRows(BusinessUnitComboBox.SelectedItems) > 0 && CountRows(DepartmentComboBox.SelectedItems) > 0 && CountRows(ProgramComboBox.SelectedItems) > 0 && CountRows(ProjectComboBox.SelectedItems) > 0 && CountRows(ActivityComboBox.SelectedItems) > 0, Edit,Disabled)
dropdown2.PNG

Community Support Team
Community Support Team

Re: Combo box disable/enable

Hi @Big_S ,

If you want the Text Box has same functionality with your other 5 ComboBoxes, please take a try with the following workaround:

Set the DisplayMode property of the "Add Transaction" button to following formula:

If(
   (!IsBlank(AmountTxtInput.Text) && Value(AmountTxtInput.Text) >= 1) && !IsBlank(ComboBox1.Selected.Value) && !IsBlank(ComboBox2.Selected.Value) && !IsBlank(ComboBox3.Selected.Value) && !IsBlank(ComboBox4.Selected.Value) && !IsBlank(ComboBox5.Selected.Value),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

Or

If(
   (!IsBlank(AmountTxtInput.Text) && Value(AmountTxtInput.Text) >= 1) && !IsEmpty(ComboBox1.SelectedItems) && !IsEmpty(ComboBox2.SelectedItems) && !IsEmpty(ComboBox3.SelectedItems) && !IsEmpty(ComboBox4.SelectedItems) && !IsEmpty(ComboBox5.SelectedItems),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

Please take a try with above solution, check if the issue is solved. If above solution I provided is helpful in your scenario, please go ahead to click "Accept as Solution" to identify this thread has been 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.
8 REPLIES 8
Super User
Super User

Re: Combo box disable/enable

@Big_S 

 

You can update the DisplayMode property of your button as:
 
If(CountRows(ComboBox1.SelectedItems) > 0 && CountRows(ComboBox2.SelectedItems) > 0 && CountRows(ComboBox3.SelectedItems) > 0 && CountRows(ComboBox1_1.SelectedItems) > 0 && CountRows(ComboBox2_1.SelectedItems) > 0, Edit,Disabled)
MicrosoftTeams-image (163).png

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Big_S
Level: Powered On

Re: Combo box disable/enable

Hi @yashag2255 

 

IT Works, however, I have 1 textbox also with same functionalities what I did is this but it's not working where did I get wrong?
If(!IsBlank(AmountTxtInput.Text) &&If(Value(AmountTxtInput.Text) >= 1, true),Edit,Disabled) & If(CountRows(BusinessUnitComboBox.SelectedItems) > 0 && CountRows(DepartmentComboBox.SelectedItems) > 0 && CountRows(ProgramComboBox.SelectedItems) > 0 && CountRows(ProjectComboBox.SelectedItems) > 0 && CountRows(ActivityComboBox.SelectedItems) > 0, Edit,Disabled)
dropdown2.PNG

Super User
Super User

Re: Combo box disable/enable

@Big_S 

 

Instead of using two if loops you can combine this into one loop as:

If(!IsBlank(AmountTxtInput.Text) &&If(Value(AmountTxtInput.Text) >= 1 && CountRows(BusinessUnitComboBox.SelectedItems) > 0 && CountRows(DepartmentComboBox.SelectedItems) > 0 && CountRows(ProgramComboBox.SelectedItems) > 0 && CountRows(ProjectComboBox.SelectedItems) > 0 && CountRows(ActivityComboBox.SelectedItems) > 0, Edit,Disabled)
Hope this Helps!
 
Community Support Team
Community Support Team

Re: Combo box disable/enable

Hi @Big_S ,

Do you want to disable the "Add Transaction" button within your app until all ComboBox have one option selected?

 

I have made a test on my side, please take a try with the following workaround:

Set the DisplayMode property of the "Add Transaction" button to following formula:

If(
   !IsBlank(ComboBox1.Selected.Value) && !IsBlank(ComboBox2.Selected.Value) && !IsBlank(ComboBox3.Selected.Value) && !IsBlank(ComboBox4.Selected.Value) && !IsBlank(ComboBox5.Selected.Value),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

Or

If(
   !IsEmpty(ComboBox1.SelectedItems) && !IsEmpty(ComboBox2.SelectedItems) && !IsEmpty(ComboBox3.SelectedItems) && !IsEmpty(ComboBox4.SelectedItems) && !IsEmpty(ComboBox5.SelectedItems),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

Please consider 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.
Big_S
Level: Powered On

Re: Combo box disable/enable

Hi @yashag2255 

I got errors like Unexpected characters. The formula contains 'ParenClose' where 'Eof' is expected.
Invalid number of arguments: received 1, expected 2 or more.


Big_S
Level: Powered On

Re: Combo box disable/enable

Hi @yashag2255 

this is working
If(
!IsEmpty(BusinessUnitComboBox.SelectedItems) && !IsEmpty(DepartmentComboBox.SelectedItems) && !IsEmpty(ProgramComboBox.SelectedItems) && !IsEmpty(ProjectComboBox.SelectedItems) && !IsEmpty(ActivityComboBox.SelectedItems),
DisplayMode.Edit,
DisplayMode.Disabled
)

I wanted also to include the text input if no value the button will disable
dropdown2.PNG

Community Support Team
Community Support Team

Re: Combo box disable/enable

Hi @Big_S ,

If you want the Text Box has same functionality with your other 5 ComboBoxes, please take a try with the following workaround:

Set the DisplayMode property of the "Add Transaction" button to following formula:

If(
   (!IsBlank(AmountTxtInput.Text) && Value(AmountTxtInput.Text) >= 1) && !IsBlank(ComboBox1.Selected.Value) && !IsBlank(ComboBox2.Selected.Value) && !IsBlank(ComboBox3.Selected.Value) && !IsBlank(ComboBox4.Selected.Value) && !IsBlank(ComboBox5.Selected.Value),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

Or

If(
   (!IsBlank(AmountTxtInput.Text) && Value(AmountTxtInput.Text) >= 1) && !IsEmpty(ComboBox1.SelectedItems) && !IsEmpty(ComboBox2.SelectedItems) && !IsEmpty(ComboBox3.SelectedItems) && !IsEmpty(ComboBox4.SelectedItems) && !IsEmpty(ComboBox5.SelectedItems),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

Please take a try with above solution, check if the issue is solved. If above solution I provided is helpful in your scenario, please go ahead to click "Accept as Solution" to identify this thread has been 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.
Big_S
Level: Powered On

Re: Combo box disable/enable

@v-xida-msft 

 

WOWOWOW! it works!!!! THANK YOU SO MUCH!!! <3

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 82 members 3,858 guests
Please welcome our newest community members: