You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Definition of "Boolean" Answer Option type

The Boolean type is used if the Answer Options of a Question represent a "Yes/No" or "True/False" choice.


Table of Contents:

 


(lightbulb) Examples of Questions that might use the Boolean Answer Option Type: "Show only products on sale", "Are you older than 18 years?", "Energy efficiency is important for me".


Why Using a Boolean Question?

A Boolean Question should be used if the Question represents a "Yes/No" choice, i.e. the question (or statement) can only be answered with "Yes" or "No". 

(info) Instead of using Boolean Questions, you can also use an ordinary Question with two Answer Options "yes" and "no" and the Answer Option Type Text. However, the second answer "No" represents the opposite of the first answer "Yes" - so we recommend using Boolean Question for yes/no-options since they are easier to configure.



Create a Boolean Question

We assume that you have a Question "Do you prefer an e-bike?" with two Answer Options "Yes" and "No". This Question can perfectly be converted into a Boolean Question.

  1. Therefore open the Answer Option type tab in the Question properties dialog.



  2.   Select the type "Boolean".



  3. The Question card appearance transforms (see image below). The Answer Options "Yes" and "No" are replaced by the option "yes". This default value can be changed afterwards to any other value like in any other Answer Option.
    The only difference is that the Answer Option ID cannot be changed due to internal functional reasons for boolean Questions.



  4. Afterwards the "yes" Answer Option can be connected to the product values from the related product attribute. The "no" Answer Option is not visible, but implicitly set to all opposite (not connected) values.
    1. See Example Simple Data Binding to learn how to connect the "yes" Answer Option with values from one attribute.
    2. See Example with Complex Data Binding to learn how to connect the "yes" Answer Option with values from multiple attributes.


Example with Simple Data Binding

After creating the Boolean Question the "yes" option has to be connected to product attributes. In this example, we describe the Simple Data Binding.

  1. We assume that the Question is already bound to a product attribute (in this case "Bike Type"). If you do not know how to bind an attribute to a Question, please look at the example in page Simple Mapping.
  2. Open the "yes" option properties dialog.
  3. Go to the "Data Binding and Connections" tab (see image below).
    (info) Note: Make sure that the product attribute "Bike Type" is visible below the label "Connected Product Attribute from data source:". Otherwise please return to step 1.
  4. Choose the attribute value "e-bike" from the selectable value from the combobox.
  5. After the selection the value is attached and the token "e-bike" is visible.
  6. You can add further values by repeating step 4 with other values.

(info) Note: All non-selected values, e.g. like "Mountain Bike" are automatically attached to the invisible "no" Answer Option. That is why it is unnecessary to implement this state in the Question card.



Example with Complex Data Binding

Furthermore the Boolean Question can also be used in combination with the Answer Option Mapping Expression. With this mapping the "yes" option can be attached to a more complex combination of different product attributes. So this can be used for example for the Question "Are there babies or small children in your household?" in a washing machine advisor.

  1. We assume that the Question is already created and the Data Binding Mapping is set to Expression. If you do not know how to set this mapping, please look at the example in page Expression Mapping.
  2. Open the "yes" option properties dialog.
  3. Go to the "Data Binding and Connections" tab (see image below).
  4. Select the attribute "child_safety_lock" and set the corresponding value to "yes". That means that the washing machine should have a child safety lock.
  5. Add another expression by clicking on the "Add Expression" button.
  6. Select the attribute "capacity" and set the corresponding value to 6.5. Also make sure that the condition is set to ">=" (greater and equals than).
    (info) Note: This mathematical condition is only selectable if the attribute "capacity" has the type "Number" (see Upload your Product Data File).
  7. Afterwards both attributes and their values are attached to the "yes" option.
  8. Of curse you can add further expressions.

(info) Note: All non-selected values, e.g. like "capacity less than 6.5" are automatically attached to the invisible "no" Answer Option. That is why it is unnecessary to implement this state in the Question card.



Further Notes

If you have configured a Boolean Answer Option Type, the following applies:

  • There is only one system-generated Answer Option ("yes"). It is not possible to add further Answer Options or to delete the existing Answer Option.
  • The option "The user can select ..." (see General Properties) will be disabled with the fixed value "one answer". This is needed because only one state can be selected at the same time.
  • All Boolean Questions can be mapped into "classic" Questions with two Answer Options. However they differ in the recommendation behavior (Christian please refine this).
  • The combination of answer option mapping Automatic and Answer Option type "Boolean" is not allowed.



Read on about the Matching & Reasoning


  • No labels