Configuration of conditions in forms and tasks

SHOW ALL CONTENT

Related articles

Introduction

Information provided by the user within the request submit form is important and we have worked on conditions on forms and tasks to better exploit it. The conditions allow forms to be dynamic and to ask questions to the user based on his previous responses.  In addition, with the conditions it is possible to adapt the workflow of the request by selecting which tasks will be generated.

Conditions apply on two types of actions:

  • Fields to display in a form.

  • The generation of a task in a service request.

Basis for the conditions

Conditions can be based on:

  • The value of a field in the custom form.
  • The value of a field in the request.
  • Whether or not a field was filled.
Visual Explanation

 

How it works

To add conditions to a field in a form or a task, you need to use the F3 key to see available fields and to add the description of a condition.  

Configuration of a condition in a form

In the dynamic form creation, the form fields and those from the request are the criteria that will be used as conditions to determine if the field is to be displayed or not to the user.

Follow these steps to add a Display condition:

  • Go to Options section.
  • Place the mouse in the Display condition field.
  • Press F3 on the keyboard.
  • Choose the field on which the condition will be based on.
  • Add the displayed condition.
  • Test the form to make sure everything works.
    • Make corrections if needed.
  • Finish with OK in the field and proceed with the configuration of the rest of the form.
Visual Explanation

Configuration of a condition for a task

When generating tasks, fields from request and form can be used as variables. These variables can then be put into the Condition field control task creation. 

Follow these steps to add a condition for task creation:

  • Place the mouse cursor in the Condition field.
  • Press F3 on the keyboard to display the custom and request fields available.
  • Make your selection and confirm with OK
Visual Explanation

How to build conditions and the available operators

Whether the conditions are used in a form or a task, the method to configure the condition is the same. As it is easier to see and validate on the visualization screen, the following examples are shown in forms.

When you prepare task conditions, test the conditions as a field display condition first, since it is the easiest way to determine if the conditions work.

You can't use a variable after the operator. It is absolutely necessary to test it with a value, as shown in the following examples.

What you need to know:

In bilingual environments, it is important to build the value list tied to combo list or radio buttons field types in both languages. The use of a comma is very useful in this mode.

Be careful when renaming a field or a choice in a value list, since it could well render a condition invalid. Use the display screen to properly validate conditions.

The comma

  • To add more then one choice to a condition, they must be separated by a comma.
    • Blue, White, Red
  • In a bilingual mode, this is how to account for both languages.
    • Yes, Oui

Quotation marks

  • Quotation marks encloses the response for text, large text, or value list value containing a comma in it. As explained in the previous point, the comma is used to separate the different valid responses in a condition. They will be used in elements of a list like:
    • iPhone 6, grey
    • iPhone 6, silver
    • LG G5, black
    • Samsung Galaxy S7, black
  • A condition based on these fields will need quotation marks to work properly:
    • [[NameOfTheVariable]]="iPhone 6, grey", "iPhone 6, silver"

Is equal to

  • Use the equal sign = in a condition based on a Combo list or Radio button type field.
    • To indicate the choice or choices that will make the condition true. 
See a detailed example
  • Use the equal = sign in a condition based on fields of the following types Check box, Date, Date and Time, File Attachment or CI
    • ​= True, indicates that the condition will be met if the field is checked or filled.
    • = False, indicates that the condition will be met if the field stays empty. 
See an example

Is different from

  • Use smaller than and greater than signs as follows <> in a condition based on a Combo list or Radio button type field.
    • To indicate the choice or choices that will make the condition true.
See an example

The field was filled or selected

Conditions can be based on the fact of adding information or using a field.  

  • Use the =True combination in a condition based on using one of the following types Check box, Date, Date and Time, Text, File Attachment or CI
    • =False will indicate the opposite, meaning that the field was left empty.
See an example

Values contained in a specific field of a form

  • A condition can be based on the text entered into a text or large text field.  
    • The text searched needs to be in quotes. 
    • Octopus does not distinguish between upper and lower case letters. 
    • Wild cards variables are not supported.
See an example

Value contained in a field from the request

  • A condition can be based on the fields of a request instead of the ones from the form, for example:
    • The Site of the user.
    • The Department of the user.
    • The VIP field of the user.
What you need to know:

Certain fields, like Site or Department, can be associated with diverse elements like the Requester, the User or the CI. It is hence very important to make the selection from the correct node .To build a condition with Site/subsites, they must be separated by comma, such as: [[Field1]] = "Site,Subsite1,Subsite2" .  

 

See a detailed example

The combination of fields

Conditions can be combined to define a condition on more than one field at a time. This works with fields from the form as well as fields from the request.  

Use the following variables to combine more than one field to a condition:

  • @OR
    • For a OR type condition, Field[[1=]]ABC@ORField[[2]]=ABC, DEF.
    • Everything can be on the same line or there can be a carriage return (Enter) to separate the first field of the variable.
    • Only one of the conditions must be true for the condition to work.
See an example
  • @AND
    • For a AND type condition, [[Field1]]= ABC @AND [[Field2]] = DEF.

    • Everything can be on the same line or there can be a carriage return (Enter) to separate the first field of the variable.

    • Every variable must be met for the condition to work.

See an example
  • Parentheses
    • Allows combining multiple operators in a single logical expression.
    • Respects operator priority by resolving expressions contained within parentheses first.
    • Parentheses must be in equilibrium on either side of an operator, e.g.: ( expr1 ) @And ( expr2 @Or expr3 ) presents the same amount of parentheses on either side of the @And operator.
 Tip: We can use conditions to present a field in which information is missing from the user's file.

For example, if the email or extension fields are empty.

The condition for an empty email field would be [[@Incident.User.Email]]=False

Error display

Over time, changes may be made to your catalog of custom fields (merging, deletion, etc.) which may leave invalid references in your query types.

Existing errors can be viewed by consulting the query types in the Reference data management menu. They will be reported as a warning by a triangle with an exclamation mark, or by a yellow circle where they occur. In the case of tasks, the number(s) of problematic tasks, i.e. where errors occur, will be indicated. See the 2nd image below.

Please note that it will still be possible to save your query type, but the presence of invalid fields or conditions will affect the desired behavior in the query types concerned.

Custom field variables can be used in the following places:

  • Alternative subject
  • Tasks
    • Subject
    • Description
    • Condition
  • Form fields
    • Display condition

Here are some examples of errors:

X
Help us improve our articles