Display Conditions

Display conditions, sometimes also called skip logic,are used to determine when a particular question should be shown to a user. While you can use the Form Builder to make basic display conditions, it is also possible to create very complex expressions.

Validation Conditions

Validation Conditions are used to require that a user enters a certain type of response. A simple example could be requiring that a date be in the future; simple expressions can be added using the Form Builder Expression Builder. However it is also possible to write very complex expressions which require a specific structure. A complex example would be requiring a code which is 5 digits long and starts with a letter.

You can also put a question-specific validation message which tells the user why their response did not meet the validation condition.

Basic Validation Conditions - this page provides some basic examples of validation expressions, including the use of dates and numeric ranges.

Advanced Validation Conditions - this page provides examples and guidelines for complex validation expressions, such as requiring a specifically formatted number or series of letters.

Make a subset of questions required - describes how to configure a set of questions such that only a certain number are required, and the user can choose which ones to answer.

Calculations

One of the most powerful features of CommCare is the ability to do calculations within a form by working with a special type of question called a hidden value. If you are just getting started using hidden values we recommend that you try going through the Hidden Value Calculations Tutorial.

Join two values ("concatenate") - example of a function which joins together two questions. For example if you have a question for first name and another for last name and want to join them into one property you can use the concatenate function.

"If" Statements - one of the most powerful tools in building CommCare calculations, this page provides examples of how if statements can help you to synthesize inputs from several questions into one output

Logic for Specific Question Types

Some question types are a bit more complex than others! These pages provide examples and explain how to work with some of these question types.

Advanced Form Design

This section has pages that you might want in order to build complex workflows or structures into your forms. Note that pages in this section may require knowledge of Case Management, a key feature of CommCare which is used to link forms together.

Advanced Tools

Available Functions - this page provides detailed descriptions and examples of all the possible CommCare Functions that you can use when making calculations or other expressions. Common examples of functions include: today(), string-length(), now(), and date() - these are very useful for manipulating data.

7 Comments

Anonymous

How do we check if the LMP date is 3 months less than the current date?I have created a Date Field to accept the LMP date. How do we check if the LMP date is 3 months less than the current date?Then, I create a label and under logic, in the "Display Condition," I enter the following code: int((today() - (/data/imp + 90)) div 30.4) to determine the number of months from the user-entered LMP date. Is it correct?