# Value maps

> A value map is a two-column list containing SKUs and values of your choice.

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

After you create a value map, the `Value_map_items` [cart item filter][cif]
becomes available in promotion and strikethrough [rules][rules] and in other [filters][filters].

You can use the <Attribute name="Mapped Value" type="filter" /> attribute in _per-item_
[effects][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][cif] 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][discount-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](/docs/product/rules/strikethrough-pricing.md),
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][discount-items] effect,
select `Value_map_items` as the list of items to discount and enter the following discount
value: <Attribute name="Item.MappedValue" type="filter" />.

After rule evaluation, your website displays the updated prices for the items.

## Example: Use a value map in cart item filters

Use the <Attribute name="Mapped Value" type="filter" /> attribute in
[cart item filters][cif] to exclude items priced below their mapped value
from rule evaluation.

For example, add a condition using the
<Attribute name="Price of item (Item)" type="builtin" /> attribute against
<Attribute name="Mapped Value" type="filter" />, with the
**is greater than or equal to** operator. The rule then evaluates items
priced at or above their mapped value.

:::note
The <Attribute name="Mapped Value" type="filter" /> 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][campaign-types] by uploading
a CSV file containing the items of the value map.

:::note
You can create only one value map for a given campaign.
:::

To create a value map:

1. 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: `identifier` and `value`.
   - One row for each SKU and its value.
   - The SKU must be a text value.
   - The value must be a numeric value.

   <Tabs groupId="group1">
   <TabItem value="csv" label="CSV" default>

   Here's an example of a valid CSV file:

   ```csv
   identifier,value
   SKU1,10
   SKU2,15.5
   SKU3,8
   ```

   </TabItem>
   <TabItem value="spreadsheet" label="Spreadsheet">
   You can create the CSV file in a spreadsheet editor, such as Microsoft Excel or Google Sheets, and export it as a CSV file.

   ![Excel screenshot](/img/value-map-excel.png)

   </TabItem>
   </Tabs>

   :::important
   The file can contain a maximum of 500,000 rows.
   :::

1. On the left-side menu of a campaign, click <RuleBuilder className="icon"/>  **Rule Builder**.
1. In the top-right corner of the page, click <Catalog className="icon"/> **Value Map**.
1. Click <Upload className="icon"/> **Upload a CSV File** and select the CSV file.
1. Click **Create Value Map**.

A [cart item filter][cif] 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](#edit-a-value-map).

To export a value map:

1. On the left-side menu of a campaign, click <RuleBuilder className="icon"/>  **Rule Builder**.
1. In the top-right corner of the page, click <Catalog className="icon"/> **Value Map**.
1. Click <Export className="icon"/> **Export Items**.

## Edit a value map

You can edit a value map by uploading a new CSV file.

:::important
The newly imported file replaces the existing value map.
:::

To edit a value map:

1. [Create a new value map CSV file](#create-a-value-map).
1. On the left-side menu of a campaign, click <RuleBuilder className="icon"/>  **Rule Builder**.
1. In the top-right corner of the page, click <Catalog className="icon"/> **Value Map**.
1. Click <Upload className="icon"/> **Upload a New CSV File** and select the CSV file.
1. 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 <Attribute name="Mapped Value" type="filter" />
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 <Attribute name="Mapped Value" type="filter" />
attribute in the campaign.

To delete a value map:

1. On the left-side menu of a campaign, click <RuleBuilder className="icon"/>  **Rule Builder**.
1. In the top-right corner of the page, click <Catalog className="icon"/> **Value Map**.
1. Click <Delete className="icon"/> **Delete Value Map**.
1. In the confirmation window, click <Delete className="icon"/> **Delete Value Map**.

## Related pages

- [Manage collections](/docs/product/rules/manage-collections.md)
- [Cart item filters](/docs/product/rules/cart-item-filters/overview.md)
- [Campaign templates](/docs/product/campaigns/templates/overview.md)

[campaign-types]: /docs/product/campaigns/overview.md#standard-campaigns
[cif]: /docs/product/rules/cart-item-filters/overview.md
[rules]: /docs/product/rules/overview.md
[filters]: /docs/product/rules/overview.md#filters
[discount-items]: /docs/product/rules/effects/use-effects.md#discount-individual-items
[effects]: /docs/product/rules/effects/overview.md
