Working With Conditions in Layouts
This guide demonstrates how to utilize conditions in layouts. You can watch the accompanying video here:
Formatting layouts is a powerful tool for building a neat app intake. Refer back to Using Layouts in Knackly to learn more about how the layout tab works, how to move variables around, and how to add extra details using the information cell.
In our example, we are walking through different options to present children's information in the app intake.
First, create a variable or an information cell you will be formatting. We created an information cell containing “##Children Section.” The use of double number signs is for formatting purposes—refer back to Formatting Your Intakes With Video, Color, and Images to learn more about creating headers using the number sign.
Hovering over the eyeball icon shows these options: always, when condition…, and with questions…
Always
This is the default setting. This simply means the variable or information cell will always appear in the app intake.
When Condition…
An option to enter an expression appears after selecting when condition… If you drag in a selection or true/false variable, then if true or yes, the section will appear. If false or no, the section will remain hidden. Save your work.
The variable in our example is ShowChildren. ShowChildren is a selection variable with Yes or No as the selection options. In the expression field, use the following expression:
ShowChildren == “Yes”
Then return to the app intake to check your work. If the selection is No, it should look like:
If the selection is Yes, it should look like:
With Questions…
In some cases, it is valuable to have multiple variables or information cells appear at the same time when working on a specific question.
The expression field will ask for a variable to appear when you select with questions… In our example, we want our header to appear with Children.
Since the beginning of Children in the app intake begins with a question: Do you have children? and is a radio button, the Children Section header does not appear.
If the radio button is selected, which means the user does have children, then the Children Section header will appear:
Please let us know if you have any comments or suggestions on how to improve this guide.