Table of Contents:
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).
It is assumed 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. Therefore change the "Answer Option Data Binding" to the type "Expression" in the "Data Binding and Connections" tab (see image below).
Furthermore your uploaded product data file contains the product attributes "price", "hdmi_port" and "display_resolution" which are used in this example.
Make sure that the attribute "price" has the type number (see Upload your Product Data - Data Attributes Table). |
Afterwards you can enter expressions for each Answer Option of this Question. The goal is to build a price range from 500 to 1000 € which represents the medium budget range.
The following steps describe how to configure this range:
After these steps, the desired price range is set for the Answer Option "medium budget".
Each expression row can be deleted by clicking on the "X" button on the right side of each row. |
The following example shows a more complex case of binding your Answer Options to multiple product data attributes.
It is assumed that you want to ask the user for what he wants to use his TV. Most of the times, different use cases require dependencies to several data attributes.
Assume a case where the user wants to buy a TV for gaming:
In this example, you connect the Answer Option "use the TV for video games..." with the two attributes "hdmi_port" and "display_resolution" (see Attribute Description). You 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 you select the values "yes" for "hdmi_port" and "full_hd" for "display_resolution". Moreover make sure that the logical operator is set to "AND".
Color | Meaning |
---|---|
Grey | The value is part of the current attribute value set (bound value). |
Yellow | The value is currently not part if the attribute value set (unbound value). Perhaps, it is an old value from an earlier data feed. Or a numeric value which although is not represented in the product data, can be used as a boundary for less or greater operators. |
Green | This color suggest, that the entered value is a subset of existing values. So all values are bound which contain (⊂) or not contain (⊄) this text. |
Purple | If the regular expressions operator is selected, the color changes to purple. Now, the value is interpreted as patterns to find more complex value connections. To use these patterns correctly, please look at this documentation. |
There are three different kinds of configurations:
All conjunctions bind stronger than disjunctions. That means that brackets are set implicit. In the last example above, the bracket would be set as follows: "( Price <= 999 AND Price >= 499 ) OR Gender = female" |