# Conditional Logic

While adding new fields to a form, you can attach certain conditional logic. Conditional logic allows you to show or hide questions/fields based on answers to previous questions. This makes the form more user friendly, more organized and hence easier to answer/fill up.

To add a condition, right click on that question/field and click on 'Set Conditional Logic' (as shown below):

A pop up window (as shown below) will appear.

There are 3 sections in this popup page that you need to answer. The system will decipher the conditionality of this field as a combination of the values of the 3 sections you have chosen.

Section 1: has 3 options. You have to choose any one.

1) "Always Show this field (no conditional logic)" - This is the default selection

2) "Hide this field if ..."

3) "Show this field if ..."

Section 2: " ... the response to the following field (select one) ... "

Here, the value(s) chosen on preceding 'single select list' question or 'multi-select list' question or a "Yes or No" question with in the same section will be displayed.

Choose the appropriate question.

Section 3: Selecting positive (inclusive) or negative (exclusive) conditionality

Here, the values of the question selected in Section 2 will be listed. Choose the values and decide whether the condition has to be applied if user selects those values OR user excludes those values.

Notes:

- Sequencing (order of appearance) of questions in a section matters
- Response types (field types) other than single select list or multi-select list or a "Yes or No" (e.g. "Alphanumeric", "Photos" etc.) cannot be used for setting conditionality.
- Only the preceding questions from the same section can be chosen for attaching conditions (as triggers).

Special Conditional fields and changes in the new "Corporate Global Store Visit Template - FY15" template"

- Prior to the new FY15 Global template, if a store was closed for any reason, required questions in the remaining sections of the form prevented the call report from being submitted until they all were entered. This caused a lot of wastage of time in submitting forms. Also, there was no way to capture a missed visit if a rep was sick, on vacation, or unable to make a visit. Now, with the new Global FY15 template, when you select Closed Temporarily, Closed Permanently, Management Refused or Missed visit, you will only see questions that are triggered for those selections.
- Earlier, separate Call Reports had to be created for monthly or quarterly tasks. This led to wasted administrative time managing multiple call reports for each retailer. Now, in FY15 Global Template, two new questions have been added to the "Visit details" section. Unlike other questions, these two Yes/No questions in "Visit Details" section can be referred to through out the entire form (regardless of sections) for setting conditions.

- 1) "Is this the first visit this month to this store?"
- 2) "Is this the first visit this quarter to this store?"

Depending on the answer (yes or no) selected for these questions, all fields/questions in the remainder of the form that have a conditional display logic attached to these question will be hidden or displayed. If you do not set that logic, the question always appears.

- Call Reports created based on the recently added "Corporate Global Store Visit Template - FY15" template has the following special conditions:

- For "Visit Status" question under "Visit Details" section, a new option namely "Missed Visit" has been added. Selecting this option will show another question "Reason for missed visit?" and disable/hide all the other sections and questions in the form.
- Similarly, if the user answers "Closed Temporarily" or "Closed Permanently" or "Management Refused" to "Visit Status" question under "Visit Details" section, most of the other questions/ sections are disabled. These are some specific controls (conditional logic) added in to "Corporate Global Store Visit Template - FY15" template

After adding / saving the conditions, click on the "Save" button on the landing page (Form Edit page) as well. Only then, the editing will be complete.

See Appendix C for the definition of available field types.