Conditional Logic: Operators and Actions

 

Note: V2 forms are gradually being rolled out to our customers.  To gain access now, please speak to [email protected].

About

Conditional logic uses two core parts to control what happens in a form -- Conditions and Actions.  Conditions use operators to text if questions match a certain rule, and actions define what happens when those things are true. 

Below are definitions of all available operators and actions, as well as information regarding what kinds of questions they are compatible with. 

 

Operators

Conditional operators are the (usually mathematical) symbols that form part of the condition. Common operators include, but are not limited to: > < =.   They allow you to compare a question's answer to either another question, or a string.

Available Operators

Operator Definition
Equals (=) Checks if the answer is an exact match (case insensitive) to another value of a comparable data type. 
Does Not Equal (!=) Checks if the answer is NOT an exact match (case insensitive) to another value of a comparable data type. 
Less Than (<) Checks if the answer is lower than another value of a comparable data type. 
Less Than or Equal To (<=) Checks if the question is lower than or an exact match of another value of a comparable data type. 
Greater Than (>) Checks if the answer is higher than another value of a comparable data type. 
Greater Than or Equal To (>=) Checks if the question is higher than or an exact match of another value of a comparable data type. 
Between  Checks if the question falls between (but is not equal to) two other values of a comparable data type. 
Contains Checks if the answer contains another value of a comparable data type.

If you are comparing a multiselect question, it checks if one of the multiselect answers is an exact match to another value.

Is Answered Checks if the question has an answer.

It is considered to have an answer if ANY value is present; whether it is a default value, a pushed value, or a user-entered value. 
Is Not Answered Checks if the question does NOT have an answer. 

 

[ top ]

 

Operators: Compatibility with Questions and Data Types

General Rules:

  1. The reference question must be a data type compatible with the operator (see tables below).
  2. If comparing to another question, that question's data type must also be compatible with the operator. 
    1. i.e. it is not valid to say "If (integer) = (date/time question)
  3. If comparing to a hard-coded value, it must be of a data type compatible with the operator. 
    1. i.e. it is not valid to say "If (email question) = 5"

The form builder will prevent you from saving a form with these mistakes. 

 

Compatibility by Operator

Name

Compatible Data Types

Incompatible Data Types

Equals

Does Not Equal

  • Freetext
  • Integer/Decimal/Currency *
  • Email/Phone Number/URL *
  • Date/Time/Date|Time
  • Single Checkbox
  • Duration

*Except Multiselect questions

  • Signature/Photo/Sketch
  • File/Audio
  • Geolocation
  • Barcode
  • Information
  • Credit Card Transaction


Control Type: Multiselect

Less Than

Greater Than

Less Than or Equal To

Greater Than or Equal To

Between

  • Integer/Decimal/Currency *
  • Date/Time/Date|Time
  • Duration

*Except Multiselect questions

  • Freetext
  • Single Checkbox
  • Email/Phone Number/URL
  • Signature/Photo/Sketch
  • File/Audio
  • Geolocation
  • Barcode
  • Information
  • Credit Card Transaction

Control Type: Multiselect

Between 
  • Integer/Decimal/Currency *
  • Date/Time/Date|Time
  • Duration

*Except Multiselect questions

  • Freetext
  • Single Checkbox
  • Email/Phone Number/URL
  • Signature/Photo/Sketch
  • File/Audio
  • Geolocation
  • Barcode
  • Information
  • Credit Card Transaction

Control Type: Multiselect

Contains
  • Freetext
  • Integer/Decimal/Currency
  • Email/Phone Number
  • Duration
  • Single Checkbox
  • Date/Time/Date|Time
  • URL
  • Signature/Photo/Sketch
  • File/Audio
  • Geolocation
  • Barcode
  • Information
  • Credit Card Transaction
Is Answered
Is Not Answered

Compatibility is by control type:

  • Text Field, Text Area
  • Dropdown/Radiobutton/Multiselect
  • Button group
  • Duration Field
  • Date/time, Date, Time selector
  • Geolocation control
  • File, Audio
  • Photo, Sketch, Signature
  • Barcode

Compatibility is by control type:

  • Credit Card Transaction
  • Single checkbox
  • Information label
  • Stepper/Slider
  • Digit extraction
  • String concatenation
  • Calculation, Duration calculation
  • Geo stamp
  • Date/time Stamp
  • Time-Based Math

[ top ]

 

 

Actions

Actions dictate what happens when a condition is true. In ProntoForms' case, actions can hide a page, make a question required or not required, and other actions - essentially, they change the user's path through the form.

 

Available Actions

Action

Applies to

Definition

Is Ignored Pages, Sections

This setting makes the form act as if the page/section and its data do not exist.  The page/section and its data will not be visible, and will not be referenced elsewhere.

Data on Ignored pages/sections:

  • Will not be submitted
  • Does not exist for mobile users
  • Will not be used in calculations or conditional logic

Any Required questions on ignored pages/sections will not be enforced.

Is Not Ignored Pages, Sections

Shows the page/section in the mobile form.

If the page/section had answers in it, was set to ignored, and is subsequently "not ignored" again, the data will still be there, unless the questions have also been cleared or reset.

Is Visible Questions Shows the question in the mobile form.
Is Not Visible Questions

Hides the question in the mobile form.  

If it is "Required", it wont' be enforced.  If it has an answer, it will not be cleared unless another action does this.  Any answer it has can affect the rest of the form, and will be submitted.

Is Required Questions Mobile users will be forced to answer the question before submitting the form (unless on an ignored page/section).
Is Not Required Questions Mobile users will not be forced to answer the question.
Is Read-Only Questions Mobile users will not be able to manually alter the answer. 
Is Not Read-Only Questions Mobile users will be able to manually alter the answer. 
Is Set to Questions Sets a specified answer for a question further ahead in the form.

*NOTE: We recommend NOT dispatching into fields that are "set to" a value using conditional logic.   It may produce inconsistent results.
Is Cleared Questions Erases an answer to a question (will erase default values). 
Is Reset

Questions

Resets a question to its default settings (i.e. return it to its default value).

 

 

Actions: Compatibility

Rules for Actions

  1. Actions must be valid for the question/item that is being acted on (see below).
  2. Actions must be performed on pages/sections/questions that occur after ALL the inputs (i.e., sequential).

 

Compatibility by Operator

Name

Compatible Question Types Incompatible Question Types

Is Visible

Is Not Visible

All

 

None 

Is Required

Is Not Required

  • Text Field/Text Area
  • Dropdown/Radiobutton
  • Button Group
  • Duration Field
  • Date, Time & Date/Time Selectors
  • Signature/Photo/Sketch
  • File/Audio
  • Geo Control
  • Barcode Scanner
  • Credit Card Transaction
  • Information
  • Multiselect
  • Stepper/Slider
  • Single Checkbox
  • Calculations
  • Time-Based Maths
  • Aggregations
  • String Concatenation
  • Digit Extraction
  • Geo Stamp
  • Date/Time Stamp

Is Read-Only

Is Not Read-Only

  • Text Field/Text Area
  • Dropdown/Radiobutton
  • Multiselect
  • Stepper/Slider
  • Single Checkbox
  • Button Group
  • Duration Field
  • Date, Time & Date/Time Selectors
  • Signature/Photo/Sketch
  • File/Audio
  • Geo Control
  • Barcode Scanner
  • Information
  • Calculations
  • Time-Based Maths
  • Aggregations
  • String Concatenation
  • Digit Extraction
  • Geo Stamp
  • Date/Time Stamp
  • Credit Card Transaction

Is Set To

  • Text Field/Text Area
  • Dropdown/Radiobutton
  • Multiselect
  • Stepper/Slider
  • Single Checkbox
  • Button Group
  • Duration Field
  • Date, Time & Date/Time Selectors
  • Signature/Photo/Sketch
  • File/Audio
  • Geo Control
  • Barcode Scanner
  • Credit Card Transaction
  • Information
  • Calculations
  • Time-Based Maths
  • Aggregations
  • String Concatenation
  • Digit Extraction
  • Geo Stamp
  • Date/Time Stamp

Is Cleared

  • Text Field/Text Area
  • Dropdown/Radiobutton
  • Button Group
  • Duration Field
  • Date, Time & Date/Time Selectors
  • Geo Control
  • Geo Stamp
  • Date/Time Stamp
  • Signature/Photo/Sketch
  • File/Audio
  • Barcode Scanner
  • Multiselect
  • Stepper/Slider
  • Single Checkbox
  • Information
  • Calculations
  • Time-Based Maths
  • Aggregations
  • String Concatenation
  • Digit Extraction
  • Credit Card Transaction

Is Reset

  • Text Field/Text Area
  • Dropdown/Radiobutton
  • Button Group
  • Duration Field
  • Date, Time & Date/Time Selectors
  • Signature/Photo/Sketch
  • File/Audio
  • Geo Control
  • Barcode Scanner
  • Multiselect
  • Stepper/Slider
  • Single Checkbox
  • Information
  • Calculations
  • Time-Based Maths
  • Aggregations
  • String Concatenation
  • Digit Extraction
  • Credit Card Transaction

 

[ top ]

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments