# How to Add Multiple Attribute Values?

In Omnitron, attributes play a crucial role in defining product characteristics, enabling filtering in the storefront, and integrating with external systems like ERPs. However, there is a key limitation: a single attribute on a product cannot hold multiple values. This tutorial walks you through the recommended approach for handling such cases by using separate boolean attributes for each value. You'll learn how to create boolean attributes via the Omnitron interface or API, configure attribute mappings for ERP integrations, and ensure that these attributes are correctly reflected in product data and storefront filtering. Whether you're managing attributes manually or through an integrator, this guide provides the complete workflow to ensure accurate attribute configuration.

## <mark style="color:red;">Understand Attribute Value Limitation</mark>

* In the current Omnitron structure, attributes on a product cannot have multiple values.
* If it is desired for an attribute to have more than one value on a product, a separate boolean attribute must be created for each value.

## <mark style="color:red;">Create Boolean Attributes via Omnitron</mark>&#x20;

* Go to **Products and Catalogs > Product Attributes** page in Omnitron.
* Click the **+ New Attribute** button to create a new attribute.
* In the form that opens:
  * Set the **Product Attribute Input Type** field to `Boolean`.
  * If the attribute will be used for filtering in the shop, set the **Is Filterable?** field to `Yes`.
  * Set the **Pre Attribute** field to `No`.

**Example:**

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2FAG699WQQumDa21UiQfgO%2FScreenshot%202025-05-28%20at%2012.52.29.png?alt=media&#x26;token=189fc9bb-c165-4aaf-8c95-a81266094848" alt=""><figcaption></figcaption></figure>

Instead of using the interface, a `POST` request can be sent to the following endpoint:

```bash
{{omnitron_url}}/api/v1/attributes/
```

**Example Body:**

```json
{
  "key": "concern_oily",
  "data_type": "bool",
  "default_value": null,
  "is_required": false,
  "is_visible": false,
  "is_searchable": false,
  "is_filterable": true,
  "is_variant": false,
  "is_variant_listable": false,
  "name": "Oily",
  "is_form_required": false,
  "is_form_field_required": false,
  "erp_code": "concern_oily",
  "pre_attribute": false,
  "is_offer": false,
  "is_localizable": false
}
```

## <mark style="color:red;">If Attribute Value Will Be Sent from ERP</mark>

#### **If the brand is using pending product:**

**i. Create Pre Attributes**

* Go to **Products and Catalogs > Product Attributes** in Omnitron.
* Click **+ New Attribute** to create a new attribute.
* In the opened form:
  * Match information with the original attribute.
  * Set **Pre Attribute** field to `Yes`.

**Example:**&#x20;

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2FYzi5cWWAfF7kCFvsOsCZ%2FScreenshot%202025-05-28%20at%2012.54.28.png?alt=media&#x26;token=79bb6274-87e5-4813-862c-ebbcd2f8eac5" alt=""><figcaption></figcaption></figure>

**ii. Map Pre Attributes**

* Go to **Integration > Mapping** and click **+ New Rule Set**.
* In the empty mapping row at the end of the page:
  * Select **Pre Attribute** in the **ERP Features** field.
  * Select the **Attribute** to be mapped in the **Attributes** field.
  * Select the **Pre Attribute** in the **Default Attribute** field.

Instead of using the interface, a `POST` request can be sent to the following endpoint:

<pre><code><strong>{{omnitron_url}}/api/v1/mappings/
</strong></code></pre>

**Example Body:**

```json
{
  "mapping_type": "attribute_value",
  "value_dict": {
    "attributes__erp_concern_oily__isnull": false
  },
  "default_value": {},
  "default_attribute": "erp_concern_oily",
  "priority": 1,
  "mapping_key": "Oily",
  "create_all_kind": false
}
```

#### **If the brand is using an Integrator:**

**i. Update Product Flow in Integrator**

* Add newly created attributes to the **Product Flow** under **Integration Flows** in Integrator.
* If needed, update the script in the flow to modify data coming from ERP.

**ii. Map ERP Values to Omnitron Attributes**

* On the **Mapping** page of the flow:
  * Create mapping between ERP values and Omnitron attributes. *(If using pending product, use pre attributes.)*

## <mark style="color:red;">Add Attributes to Attribute Sets</mark>

To reflect the newly added attribute on products, it must be added to the relevant attribute sets.

* Go to **Products and Catalogs > Product Attribute Sets** in Omnitron.
* Edit the attribute sets where the attribute will be used.
* If attribute should not be used for filtering on certain products, set **Is Filterable?** to `No` in those attribute sets.

## <mark style="color:red;">Reflect Attribute Values on Products</mark>

* **If the brand is using ERP:**
  * Add new attributes to the product in the ERP system.
* **If ERP is not used:**
  * Enter attribute values via Omnitron.

## <mark style="color:red;">Enable Filtering by Attribute in the Shop</mark>

In order for products to be filterable by the newly added attributes in the shop, filters must be added to the URL using the attribute name and value.

**Example:**

```
/?attributes__concern_oily=True&attributes__concern_sensitive=True
```
