Show, hide or disable
Introduction
Use the Hide or Disable rule to hide, disable, show or enable a field or a component in a Kianda form. This rule is very useful if you want different parts of a form, a complete form or multiple forms, to appear or hide based on how the form user completes the form.
There are seven possible actions within this rule that can be applied to fields or forms:
- Hide from the user (not visible)
- Show to the user (visible)
- Disable for the user (not enabled)
- Enable for the user (enabled)
- Toggle visible: toggle between visible and not visible
- Toggle enable: toggle between enabled and not enabled
- Hide and clear: hide from the user (not visible) and clear the contents
When to use
You can add this rule:
-
to a field
-
to a form
-
to a process (the rule will run on load)
How to get started
The following steps illustrate a scenario to hide and show fields. The same steps can be applied to enable, disable, toggle enable and so on. To dynamically hide a field:
-
If you have the role Administrator or Design business process, go to Administration > Designer, open an existing process or create a new process and decide which form or field you will apply the rule to, by clicking on that item so that it is in edit mode so you can see the Edit/pen button, Pen button .
-
Click on Add a rule > Workflow > Hide or Disable.
-
In the Edit rule - Hide or Disable dialog box, give the rule a title in the Title field.
-
If you want to add conditions for the rule, click on the Edit conditions button to create conditions for the rule, see Conditions for more details.
-
Under Action create one or more actions for the rule by clicking on the empty field to add a form or form field, and then choose an option from the action drop-down list, choosing from Hide, Show, Disable, Enable, Toggle visible, Toggle enable, or Hide and clear, see Introduction for an explanation of each action.
For example in the image above, a Feedback field will be hidden, using Hide, based on a condition, when a field Management decision equals a value ‘Yes’.
-
To add more actions, click on Add. At any time remove an action by clicking on the Bin/Trash icon beside the name of the action.
-
Just like an ‘if..else’ statement, you can add alternative/elsewise actions, based on different conditions by clicking on Add otherwise action.
In the example above, Signature and Training materials field will show and a Feedback field will hide, while a Management decision field has a value of Yes, otherwise the shown fields will hide, while the Feedback field shows No. The result is a dynamic form that will reveal particular fields based on user input for the Management decision field.
-
To remove the otherwise action(s), click on the Remove otherwise action fields.
-
When you are finished editing the dialog box, click on OK or click on Close at any time to exit the dialog box.
-
If the rule is attached to a field within a form, a rule notification will appear within the form design, for example a rule is applied to the field Management decision as shown in the image below.
-
When you click on the field or form that has the rule attached, the rule will appear in the right-hand pane under Rules.
The next section will cover how to use the buttons visible in the right-hand pane to manipulate the rule.
Editing, deleting or duplicating rules
When you have clicked on an existing rule, and the rule is visible in the right-hand pane under Rules, there are a number of options available to you.
-
To disable a rule, click the slider across beside the rule name.
-
To copy a rule, click on the Duplicate button beside the rule name.
-
To delete a rule, click on the Bin/Trash button .
-
To view a rule, click on the rule name to open the Edit rule dialog box.
User tip
Note, it is not necessary to add a condition to the rule. In this case the rule will be triggered automatically:
- if the rule is applied to a field, then the rule will be triggered when the user enters a value in that field.
- if the rule is applied to a button, then the rule will be triggered when the user clicks the button.
- if the rule is applied to a form, then the rule will be triggered when the form is submitted.
- if the rule is applied to a process, then the rule will be triggered on load, that is when the process is initiated.
If a rule causes a mandatory field to be hidden or disabled, this will not stop the form from being submitted.
What’s next
To find out more about other workflow rules go to Workflow.
To find out more about other rules go to Rules.