Value maps
A value map is a two-column list containing SKUs and values of your choice.
After you create a value map, the Value_map_items cart item filter
becomes available in promotion and strikethrough rules and in other filters.
You can use the Mapped Value attribute in per-item
effects to reference the values that are mapped to the respective SKUs
in Value_map_items. You can also use it in cart item filters to filter
items by their mapped values.
Example: Use a value map in promotion rules
Let's imagine you want to offer a large list of SKUs at updated prices during a campaign with promotion rules. You can use a value map to create the list of SKUs and the prices you want to set for them.
When you apply the Discount individual items effect,
select Value_map_items as the list of items to discount. The discount
value formula depends on the discount type:
| Discount type | Value map contains | Discount value formula |
|---|---|---|
| Percentage discount | The percentage, for example, 10% off on leather shoes. | Item.Price * (Item.MappedValue / 100) |
| Flat discount | The discount amount, for example, €5 off on leather shoes. | Item.MappedValue |
| Fixed price | The target price, for example, all leather shoes at a fixed price of €50 today. | Item.Price - Item.MappedValue |
Example: Use a value map in strikethrough rules
For campaigns using strikethrough pricing, you can use the values mapped to individual SKUs in a value map to display the updated prices for items on your ecommerce website.
When you apply the Discount individual items effect,
select Value_map_items as the list of items to discount and enter the following discount
value: Item.MappedValue.
After rule evaluation, your website displays the updated prices for the items.
Example: Use a value map in cart item filters
Use the Mapped Value attribute in cart item filters to exclude items priced below their mapped value from rule evaluation.
For example, add a condition using the Price of item (Item) attribute against Mapped Value, with the is greater than or equal to operator. The rule then evaluates items priced at or above their mapped value.
The Mapped Value attribute is available only
in cart item filters that use the Value_map_items filter type.
Create a value map
You can create a value map in standard campaigns by uploading a CSV file containing the items of the value map.
You can create only one value map for a given campaign.
To create a value map:
-
Create a UTF-8 CSV file containing the items of the value map. The file must have the following structure:
- A header row with 2 columns:
identifierandvalue. - One row for each SKU and its value.
- The SKU must be a text value.
- The value must be a numeric value.
- CSV
- Spreadsheet
Here's an example of a valid CSV file:
identifier,value
SKU1,10
SKU2,15.5
SKU3,8You can create the CSV file in a spreadsheet editor, such as Microsoft Excel or Google Sheets, and export it as a CSV file.
ImportantThe file can contain a maximum of 500,000 rows.
- A header row with 2 columns:
-
On the left-side menu of a campaign, click Rule Builder.
-
In the top-right corner of the page, click Value Map.
-
Click Upload a CSV File and select the CSV file.
-
Click Create Value Map.
A cart item filter named Value_map_items is automatically created.
Export a value map
You can download a copy of the current value map as a CSV file. Use this file, for example, to make further changes to it and replace the current value map.
To export a value map:
- On the left-side menu of a campaign, click Rule Builder.
- In the top-right corner of the page, click Value Map.
- Click Export Items.
Edit a value map
You can edit a value map by uploading a new CSV file.
The newly imported file replaces the existing value map.
To edit a value map:
- Create a new value map CSV file.
- On the left-side menu of a campaign, click Rule Builder.
- In the top-right corner of the page, click Value Map.
- Click Upload a New CSV File and select the CSV file.
- Click Save.
The current value map items are replaced by the items from the new CSV file.
The Value_map_items cart item filter and the Mapped Value
attribute now reference the items from the updated value map.
Delete a value map
You can delete a value map if there are no active references to
the Value_map_items cart item filter and the Mapped Value
attribute in the campaign.
To delete a value map:
- On the left-side menu of a campaign, click Rule Builder.
- In the top-right corner of the page, click Value Map.
- Click Delete Value Map.
- In the confirmation window, click Delete Value Map.