...
The "Expression" data binding option allows to map each Answer Option to more complex rules. These rules allow mapping an Answer Option to expressions containing values of different product attributes. Thus, expression mapping is the most powerful of the three Types of Answer Option Data Binding.
Since the binding of Answer Options to data attributes can differ for each Answer Option, the configuration dialog for the attribute binding is placed in the Answer Option properties dialog and not in the Question (compare to Single Attribute Connection in Answer Option).
When is the Expression Mapping Recommended?
...
- Whenever you need a more complex logic with AND (conjunction) or OR (disjunction) statements.
- e.g. examples in How to Configure More Than One Logical Operator?
- Whenever you want to connect one Answer Options to several data attributes.
- If you want to use mathematical comparison operators, like less or greater, in connection with attributes of type number.
- e.g. for the price attribute
...
- Attribute: You can choose any product attribute from the uploaded product data file. This also gives you the flexibility to build expressions for one Answer Option across a variety of product attributes.
- Cond. ("condition"): Set the mathematical operator that compares the Attribute with the selected Value.
- For data attributes of the type "Text" or "Boolean" you can choose between the "=" (equal) and "≠" (unequal) operators.
- For attributes with type "Number" you may also select the operator "<" (less), "<=" (less equal), ">" (greater) or ">=" (greater equal).
- All possible mathematical operators are: =, ≠, <, <=, >, >=
- Value: Represents one data attribute value from the selected product attribute.
- Logical operator: You can select "AND" (conjunction) and "OR" (disjunction) operators between two expression rows.
- "AND" means that both expressions have to be true at the same time for a product to match. The example in Connect a Single Attribute to an Answer Option will be interpreted as: a product should cost between 500 and 1000.
- "OR" means that at least one of the two expressions has to be true to match with a product.
...
We assume that you want to ask a Question about the price range a user is willing to spend. Every Answer Option represents a certain price range.
These price ranges can easily be expressed with mathematical operators. That is why we change the "Answer Option Data Binding" to the type "Expression" in the "Data Binding and Connections" tab (see image below).
Product Data File
Furthermore your uploaded product data file contains the product attributes "price", "hdmi_port" and "display_resolution" which are used in this example.
Anchor | ||||
---|---|---|---|---|
|
...
Note | ||
---|---|---|
| ||
Make sure that the attribute "price" has the type number (see Upload your Product Data - Data Attributes Table). |
Anchor | ||||
---|---|---|---|---|
|
...
After these steps, the desired price range is set for the Answer Option "medium budget".
Info | ||
---|---|---|
| ||
Each expression row can be deleted by clicking on the "X" button on the right side of each row. |
...
Assume a case where the user wants to buy a TV for gaming:
In this example, we connect the Answer Option "use the TV for video games..." with the two attributes "hdmi_port" and "display_resolution" (see Attribute Description). We want to achieve that the TV has at least one HDMI port for the console and Full-HD resolution for a good gaming experience. That is why we select the values "yes" for "hdmi_port" and "full_hd" for "display_resolution". Moreover make sure that the logical operator is set to "AND".
...