# Understanding a unique ID

### A unique ID in Channable

A unique ID is an **identifier that we use to identify your items within Channable**. It’s important that every item has its own unique ID, meaning no two items should share the same ID.

Uniqueness is especially important when using features like [AI enriched attributes](https://app.gitbook.com/s/u8whzIfip72Kvn3M1bsc/optimize-attributes-with-ai/ai-enriched-attributes-in-channable) in **Optimize**:

* Channable uses the unique ID field to apply and track these enrichments.
* If your product data contains new and refurbished versions of the item and they share the same ID, they will be treated as the exact same item by Channable.
* If multiple items share the same Unique ID, and one of them is enriched (e.g. with an AI-generated attribute), all items sharing that ID will receive the same enriched attributes.
* Duplicate IDs can lead to errors. For example, an enriched color attribute meant for a pair of sneakers being incorrectly applied to a t-shirt.

Examples of commonly used unique ID fields:

* id
* SKU
* product\_id
* mpn

### How Channable automatically selects your unique ID

{% hint style="info" %}
**Note:** We automatically select a unique ID for the items in your project. It is not necessary to check your unique ID until you use features in **Optimize**.
{% endhint %}

Based on your product data, we’re usually able automatically to select a unique ID for your items in your Channable project. We choose this ID using:

* the name of the field (commonly used unique ID fields)
* how many other products have the same ID (duplicates)
* the length of the values in the field (no longform texts)

Based on these factors, we choose the ID field that has the least amount of duplicates.

If you are setting up AI-related attributes in **Optimize**, you will be notified via a banner that a unique ID was automatically set up:

{% stepper %}
{% step %}
Go to **\[your project] > Optimize**.
{% endstep %}

{% step %}
Click the **AI enriched attributes** tab.
{% endstep %}
{% endstepper %}

If we can select a unique ID for your product data, a banner will show indicating the field that we chose. If we cannot select a unique ID, you need to set one up manually.

### How to set up a unique ID (from Optimize or manually)

If we could not select a unique ID for your items, you can select one in **Optimize > AI enriched attributes** from the banner OR you can set one up manually:

{% stepper %}
{% step %}
Go to **\[your project] > Setup**.
{% endstep %}

{% step %}
Go to the **ID fields** tab.
{% endstep %}

{% step %}
At **Field containing Unique ID**, select a unique ID. Make sure to choose the option that has the least amount of duplicates.
{% endstep %}

{% step %}
Click **Save**.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
**Important:** If you select an ID that has duplicates (multiple products share the same ID), add an import rule to [remove the duplicate items](https://app.gitbook.com/s/u8whzIfip72Kvn3M1bsc/rules-bulk-edit-and-enrich/how-to-use-actions-then-in-rules/rule-action-remove-duplicate-items).
{% endhint %}

<figure><img src="https://content.gitbook.com/content/UAGSVlvcNsqEqVUgr0tD/blobs/AYQeVBWk6k32EQ61mZi9/30242923636370" alt=""><figcaption></figcaption></figure>

### Unique ID errors

When selecting a unique ID field at Field containing Unique ID, you may see an indication in the dropdown that the field contains duplicates.&#x20;

* **If the field contains duplicates**
  * If you know your field has duplicate entries, apply a rule to [remove the duplicate items](https://helpcenter.channable.com/hc/en-us/articles/360011144819-Rule-Remove-duplicate-items).
* **If the field does not contain duplicates**
  * If you are certain that the data in the field is unique but you are still seeing a “x duplicates" warning, it is likely, e.g., a character limit issue and the field contains 50+ characters. We flag “bad ID candidates” and not only fields with duplicates, but we display only “duplicate(s)” message in order not to make it more complicated for user, since the majority of cases are about duplicated values.

<figure><img src="https://4234638086-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUAGSVlvcNsqEqVUgr0tD%2Fuploads%2FoEe8ZQXeZLZWThTIsVCY%2Funknown.png?alt=media&#x26;token=3cfe5e67-fc98-4202-a6e2-66c1bb76065a" alt=""><figcaption></figcaption></figure>

### How to change a unique ID

{% hint style="danger" %}
**Caution:** If you change your unique ID and you have already generated attributes or texts in **Optimize**, these values will be removed.
{% endhint %}

{% stepper %}
{% step %}
Go to **\[your project] > Setup**.
{% endstep %}

{% step %}
Go to the **ID fields** tab.
{% endstep %}

{% step %}
At **Field containing Unique ID**, select a different unique ID. Make sure to choose the option that has the least amount of duplicates.
{% endstep %}

{% step %}
Click **Save**.<br>
{% endstep %}
{% endstepper %}
