cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thanasis
Helper IV
Helper IV

Comb box to control visibility of checkboxes

What I am trying to do is ,  I have a combobox that you can select multiple options. If you select the option "Encompass" I want 2 checkboxes (Yes and No) to appear.
IF you select the Yes checkbox I want a text input to appear and the No checkbox to disappear. 
If you select the No checkbox I want an attachment upload to appear and the Yes checkbox to disappear.
I have them kind of working but I need some help to finish it.
What I am having trouble is when you select from the data source encompass first and then you pick another one, my checkboxes disappear even if Encompass is selected, but also what I want is if you deselect encompass I want to reset the comboxes to no checkmarks and the texinput to disappear also.
I know its a lot please let me know if you need more information. This is what I have done 

 

I have my Datasource the onchange properties to be :

 

If(ComboBoxDataSource.Selected.Value="Encompass", Reset(CheckboxYes), false )

 

Thanasis_1-1618586740646.png

 

For Yes and No checkboxes I have this oncheck and Unkceck 
oncheck:  UpdateContext({vis:true}) / UpdateContext({vis2:true})
uncheck:  UpdateContext({vis:true}) /  UpdateContext({vis2:true})

 

and for the visibility of my text input and my Attachment I have set is as

vis and vis2.

 

If you need any more information please let me know. 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Thanasis 

Set your Visible properties as follows:

YesCheckBox:  "Encompass" in ComboBoxDataSource.SelectedItems.Value && !NoCheckBox.Value (note: Value may not be an applicable column in your items table - substitute for correct one if needed or reply back with the items property of the combobox)

NoCheckBox:  YesCheckBox.Visible && !YesCheckBox.Value

TextInput control:  YesCheckBox.Value

AttachmentUpload : NoCheckBox.Value

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@Thanasis 

Set your Visible properties as follows:

YesCheckBox:  "Encompass" in ComboBoxDataSource.SelectedItems.Value && !NoCheckBox.Value (note: Value may not be an applicable column in your items table - substitute for correct one if needed or reply back with the items property of the combobox)

NoCheckBox:  YesCheckBox.Visible && !YesCheckBox.Value

TextInput control:  YesCheckBox.Value

AttachmentUpload : NoCheckBox.Value

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
RodCha
Resolver II
Resolver II

PA_S1.png

PA_S2.png

  

  

Thanasis
Helper IV
Helper IV

Hello @RandyHayes 

Thank you, that fixed my issue. I did had an issue with the Nocheckbox. I had to change visible properties to :

"Encompass" in ComboBoxDataSource.SelectedItems.Value && !Yescheckbox.Value

because YesCheckBox.Visible && !YesCheckBox.Value once click would make the No disappear too. 
I also changed my on change property for Data source to :  
because if someone decides to uncheck it, if they made a mistake, I want everything to be reset. 

If(ComboBoxDataSource.Selected.Value="Encompass", Reset(Yescheckbox) && Reset(Nocheckbox) && Reset(TextAddFolderName) && ResetForm(Form6) , false )

my attachment visible property to:

"Encompass" in ComboBoxDataSource.SelectedItems.Value && Nocheckbox.Value

and my Texinput visible property to:

"Encompass" in ComboBoxDataSource.SelectedItems.Value && Yescheckbox.Value


I also want to thank @RodCha  for your input. 

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,995)