Forum Discussion
Eoclean-LH
Feb 18, 2019Copper Contributor
DataField visible Checkbox
Hi,
I have a DataField called "Car" it should only be shown when the CheckBox "Car" is true.
It works when I put this into Visible: If(Check_Car.Value=true;true)
The problem is when you start a new form the DataField "Car" is shown. You have to select and unselect the Checkbox, then it's gone.
Is there a variable i have to put into OnStart to clear the form?
4 Replies
- Alan MarshallIron ContributorCreate a variable using the update context to store the a true false value and make it false by default or use an if to set based on the data, put this in onStart or Onvisible. Set visible value on your car data field to be the variable, it will always be true or false. On the checkbox add an on update to set the variable to the value of the checkbox field itself. I find it's always better to use a variable to store the show hide value rather than reference the field directly. If you need
- Eoclean-LHCopper Contributor
Thank you. I set it like in this post:
https://powerusers.microsoft.com/t5/General-Discussion/Control-conditional-visibility/td-p/57476
Now I've the problem that when I view the list item the check boxes are "unchecked" and do not show the content in the form (see Word file)
- Alan MarshallIron ContributorThat post is the correct approach. Are your check boxes data associated with the field and the default is the item value?
You will need to add an Onvisible to also check if those checkboxes are true and update your context variable otherwise nothing will be visible in edit mode