cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jason13
Regular Visitor

DatacardValue with Gallery checkboxes

Jason13_0-1670484159624.png

Hi there, I wanna know is there any way to show/hide the textbox when the checkbox is checked/unchecked?

1 ACCEPTED SOLUTION

Accepted Solutions
LaurensM
Super User
Super User

@WarrenBelzyour solution is correct if he is referencing the checkbox.value in the gallery.
In this case the scope of Checkbox.value is limited to that item.

However I think @Jason13 wants to show/hide fields outside of the gallery.
In this case this can be solved by using a collect function and a removeIf function in the oncheck or uncheck property.

 

OnCheck:
Collect(colVisibility, ThisItem.YourTextField)

OnUnCheck
RemoveIf(colVisibility, Value = ThisItem.YourTextField)

 

 

The visibility of your text fields outside the gallery can be done by (Phone Ext as example):

 

"Phone Ext" in colVisibility

 

 This will show the Phone Ext if it is checked.

I hope this helps!

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @Jason13 ,

Yes easily - make the Visible of the Text Box (with your control name)

YourCheckBoxName.Value

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

MVP (Business Applications)   Visit my blog Practical Power Apps

 

Jason13_0-1670485182388.png

But I'm using gallery for the checkbox section, so there is only 1 checkbox name for each of the selection. Is there another way to solve this problem

@Jason13 ,

I don't quite follow you model here based on your image, but you may be able to specify the selected item

GalleryName.Selected.CheckBoxName.Value

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

MVP (Business Applications)   Visit my blog Practical Power Apps

LaurensM
Super User
Super User

@WarrenBelzyour solution is correct if he is referencing the checkbox.value in the gallery.
In this case the scope of Checkbox.value is limited to that item.

However I think @Jason13 wants to show/hide fields outside of the gallery.
In this case this can be solved by using a collect function and a removeIf function in the oncheck or uncheck property.

 

OnCheck:
Collect(colVisibility, ThisItem.YourTextField)

OnUnCheck
RemoveIf(colVisibility, Value = ThisItem.YourTextField)

 

 

The visibility of your text fields outside the gallery can be done by (Phone Ext as example):

 

"Phone Ext" in colVisibility

 

 This will show the Phone Ext if it is checked.

I hope this helps!

Jason13
Regular Visitor

Thank you very much ~! @WarrenBelz  and @LaurensM , the problem has been solved🤗  

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (4,212)