USER GUIDE

Home / Al-Khawarzmi Designer / Validations & Logic

Validations & Logic

How to specify question length

Question length indicates the maximum number of letters, numbers and symbols allowed to be entered.

After open question’s edit page, select the max length.

Figure 60 : specifying question length

How to determine min and max value for a number question

After adding a number question, you can determine min and max value by open edit number page then select the min and max value.

Figure 61 : Edit number screen

How to add regular expression validation to a question

For the of any text based question, you can find a predefined list of regular expressions based of the question type (Number, Text … ) or you can choose other and write any valid expression.

Open edit page then select the type of Regular expression.

Figure 62 : Adding regular expression

How to change question default visibility

Click on edit icon of any question or control or page, and from the question settings you can uncheck or check the visible option to control whether the question will be shown or not once the user open the survey..

Figure 63 : Changing question default visibility
INFO
  • Default visibility only affects the first display of questions before the user starts to answer and visibility then controlled by the rules.

How to change question default enable option

Open edit page then check the check box Read Only.

Figure 64 : Edit screen

How to add unique answer validation to free text question

To add a unique answer, open the edit screen then click on Unique check box and write a message that will appear when repeating the same answer.

Figure 65 : Adding unique answer validation

How to limit the number of chosen answer in multi check box list

When add checkbox list question, then open edit check box popup, select the max number of answers.

Figure 66 ; Max number of answers

How to add new validation rule

From Logic page, click on NEW RULE.

Figure 67 : Adding new validation rule

How to duplicate a rule

From Logic page, click on duplicate icon () next to rule you want to duplicate it.

Figure 68 : Duplicating a rule

Click Save or change rule description.

Figure 69 : Duplicating a rule

How to delete a rule

From Logic page, click on delete icon () next to rule you want to delete it.

Figure 70 : Deleting a rule

A popup message appear “Are you sure you want to delete the rule?”, click OK to delete the rule.

Figure 71 : Deleting a rule

How to disable a rule

To disable a rule, click on the rule from Logic page then click on edit icon (), click on Disabled check box.

Figure 72 : Disabling a rule

How display all rules related to a question

From Logic page, click on get items rule icon () next to question you want to display all rules related to it, the rules will appear at left of screen.

Figure 73 : Displaying all rules related to a question
INFO
  • The displayed rules of the question whether the question was part of the condition or actions.

How to change the order of execution of rules added on a specific question

From Logic page, click on sort rules icon () next to question you want to change order of execution of rules added on its question.

A popup appear, sort the rules by drag and drop move then click Save.

Figure 74 : Changing order of rules
INFO
  • The importance of rules sequence per question is in the execution once the user answers the question; for example, if a question has error message rule and skip rule; if the skip rule has true result and executed then error message has false result and rolled back the answer entered by the user then the skip rule executed on a wrong answer.

How to add an error/ warning message validation rule

To display error or warning message to respondents while answering questions, do the following:

  1. Click New Rule from the upper left of the screen.
  2. Add Conditions based on questions value or function result or a mathematical equation result
  3. Click Actions tab.
  4. Select Error/Warning message from Action Type.
  5. Insert Message Text in English and Arabic.
Figure 75 : Error / warning message

The following screen shows an error message if the condition is verified.

Figure 76 : Error / warning message

How to add a skip logic rule

From Logic page, click on NEW RULE, then select conditions.

Figure 77 : Adding a skip logic rule

After filling the condition, now select actions and choose action type as Hide Question.

Figure 78 : Adding a skip logic rule

In the example above, if the answer to a question “Age?” equal “18”, the “Gender” question will hide.

Figure 79 : Adding a skip logic rule

How to hide/ show a survey statistical unit

From Logic page, click on NEW RULE, then select conditions.

Figure 80 : Hide / show a survey statistical unit

After filling the condition, now select actions and choose action type as Hide Group / Show Group.

Figure 81 : Hide / show a survey statistical unit

In the example above, if the answer to age question equal “18”, the tab 1 group will hide.

Figure 82 : Preview screen

INFO
  • Hide / show group used in grid, matrix, section, tab, and tab group.

How to hide/ show question answers based on a condition

In case to hide/show answer actions, do the following:

  1. Click New Rule from upper left of screen.
  2. Add Conditions based on questions value or function result or a mathematical equation result
  3. Click on Actions tab.
  4. Select (hide/show) answer from Action Type.
  5. Select Page.
  6. Select Questions (multiple answers question).
  7. Select Answers.
Figure 82 : Hide/ show question answers based on a condition

How to apply an action on a question in a specific row in a grid or matrix

From Logic page, click on NEW RULE, then select the condition.

Figure 83 : Logic page

After filling the condition, now select actions that will apply.

Figure 84 : Logic page

Then use () to determine where the action will be applied.

Figure 85 : Logic page

In the example above, if the number question in the grid equal “3”, the “text question label?” in this specific row will disable.

Figure 86 : Preview screen

How to add a mathematical equation a set the result a specific question

From Logic page, click on NEW RULE, then select conditions.

Figure 87 : Adding mathematical equation

After filling the condition, now select actions and choose action type as Set Value.

Figure 88 : Set value action type

In the example above, if the question number1 “not null” and the question number2 “not null”, the total question will calculate the sum of two questions.

Figure 89 : Preview page

How to execute an action based on the result of a mathematical equation

From Logic page, click on NEW RULE, then select conditions “mathematical operation”.

Figure 90 : executing an action based on the result of a mathematical equation

Then use () To determine the calculation process.

Figure 91 : Mathematical operation

After filling the condition, now select actions.

Figure 92 : selecting action type

In the example above, If the sum of the two questions is 5000, the system will appear error message.

Figure 93 : Preview page

How to execute an action based on a combination of two or more conditions

When finish adding first condition, click on () to add more conditions.

Figure 94 : Adding more conditions

You can add a set of condition in brackets by click on () icon.

Figure 95 : Adding brackets
INFO
  • Use “And/or” condition to connect these conditions with each other
  • In the case of “And” condition that means every condition must be met to apply the action, if one condition is not met, the rule will not apply the action.

How to use a predefined function and set it’s result in another question

From Logic page, click on NEW RULE, then select conditions.

Figure 95 : Using a pre-defined function

After filling the condition, now select action type set value and choose function instead of answer or value then choose the function type and on what question should be applied if applicable.

Figure 96 : Using a pre-defined function

In the example above, If the label number question in the grid equals “5”, the system will calculate the sum of label question rows and put it in the “total” question.

How to hide/ show a visual control in the survey

From Logic page, click on NEW RULE, then select conditions.

Figure 97 : hide/ show a visual control in the survey

After filling the condition, now select actions and choose action type as Hide Control / Show Control.

Figure 98 : hide/ show a visual control in the survey

In the example above, If the answer to the number question equal “18”, the system will hide the button.

INFO

Hide or Show controls used in Buttons, audio, notes, QR code, locate me, and icon.

How to control survey navigation based on a business conditions

From Logic page, click on NEW RULE, then select conditions.

Figure 99 : Logic page

After filling the condition, now select actions and choose action type as Go Action Path, then click on “Action Path” and choose where the system go when click on the button.

Figure 100 : Go action path

Then back to Builder page, open the edit button popup then choose “Add Rule” as the action path.

Then choose action path rule that created in logic page.

Figure 101 : Edit button screen

Click on Save.