# Manage attributes

> Attributes are the key to customizing your rules as much as you want. Use attributes to represent any information about the following entities:

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

- Application
- Campaign
- Cart Item
- Coupon
- Customer profile
- Customer session
- Event
- Giveaway
- Loyalty card
- Referral
- Store

<FeatureAccessInfoBox>
Only admins and Application admins have access to this feature.
</FeatureAccessInfoBox>

Use attributes inside rules, usually within conditions, in the [Rule Builder][rule builder], and
describe them by:

- Their type (`number`, `string`, `list`, etc.)
- Their [definition](#built-in-and-custom-attributes) (<Attribute name="Built in" type="builtin" />
   or <Attribute name="Custom" type="custom" />)
- Their name
- The entity they belong to in the above list

Learn more about attributes in our [Developer docs](/docs/dev/concepts/attributes.md).

## Built-in and custom attributes

The attribute definition describes the nature of an attribute.
Talon.One allows you to manage built-in and custom attributes.

| Attribute definition | Description                                                                                                                                     |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Built-in attribute   | Provided by default, such as the name of a customer or the value of a coupon. See [Display attributes](#display-attributes).              |
| Custom attribute     | When the built-in attributes do not represent the data of your business activity, you can create your own attributes, called custom attributes. |

Additionally, <Attribute name="Filter" type="filter" /> attributes are automatically created
when you create a [cart item filter](/docs/product/rules/cart-item-filters/overview.md)
or [bundle definition](/docs/product/rules/create-and-manage-bundles.md).
You can select them when they are available in the [Attribute Selector](/docs/product/rules/overview.md#attribute-selector),
but you cannot manage them.

## Example

Let's imagine you own a bike-rental business. Users can get free minutes if they return
their rental bikes to certain locations.

A sample rule for this is:

- Condition: Check if the bike location at the end of the rental is one of the special locations.
- Effect: Award `x` minutes to the customer profile.

Talon.One does not provide a *minutes* attribute for customer profiles, so we can create a
custom attribute to represent this data. We can call it <Attribute name="Minutes" type="custom" />. It is a *number*, and
it is associated with the *customer profile* entity.

## Create a custom attribute

To send specific data to Talon.One, create custom attributes, set a value for them via the
Integration API or via the Campaign Manager and use them in your Rules.

To create a custom attribute:

1. On the leftmost menu, click <Account className="icon"/> **Account**,
   then click <Tools className="icon"/> **Tools** > **Attributes**.
1. In the top-right corner of the page, click <Add className="icon"/> **Create Attribute**.
1. In **Entity**, choose the entity that owns the attribute.

   If you select **Loyalty card** as the entity, you can connect it to a
   [card-based loyalty
   program](/docs/product/loyalty-programs/card-based/card-based-overview).

1. In **Type**, choose the type of value that can be assigned to the attribute.
1. In **API name**, type an identifier for the custom attribute. This is used for
   integration purposes.
1. In **Name**, type the name of the attribute. This is the name that you
   see in the [Rule Builder][rule builder].
1. In **Description**, type a description of what the attribute represents.
1. (Optional) In **Picklist values**:

   - In **Enter picklist values**, enter a list of values for the attribute.
   - If you have to enter more than 50 values, in **Import picklist values**, upload a CSV
     file with up to 500,000 values. Imports overwrite previous and any manually
     entered values.
   - (Optional) To allow users to enter their own values when using the attribute in the Rule Builder,
     select **Allow users to enter custom values in the Rule Builder**. By default, users are
     able to use picklist values only after you import or manually enter some.

   :::note
   Picklist values are not available for attributes of type **Boolean**,
   **Location**, and **List of Locations**. See [Picklist
   values](#picklist-values).
   :::

1. In **Connected Applications**, select which Applications the attribute is available in.

   If you selected **Loyalty card** as the entity, you can only connect to a
   card-based loyalty program and not an Application.

   In **Connected Loyalty Programs**, select the card-based loyalty programs the
   attribute is available in.

   :::note
   Custom attributes with associated entity **cart item** can also be
   connected to [cart item catalogs](/docs/product/account/dev-tools/manage-cart-item-catalogs.md).
   :::

1. Click **Create Attribute**.

This attribute is ready to be used but has no value yet.
See [Set the value of an attribute](#set-the-value-of-an-attribute).

:::note
- Custom attributes with associated entity [**store**](/docs/dev/concepts/entities/stores.md)
  are connected to all the stores in an Application.
- You can reuse the **Name** and **API name** values of a [custom attribute you deleted](#delete-a-custom-attribute)
  after a few minutes of waiting.
:::

## Picklist values

Use this feature to select predefined values from a drop-down menu when using attributes
in the Rule Builder. Picklist values are available in [conditions](/docs/product/rules/conditions/use-conditions.md)
and [cart item filters](/docs/product/rules/cart-item-filters/overview.md). They
are useful to prevent mistakes when setting up campaigns involving many items.

For example, if your business is a supermarket and you want to create campaigns based on items
in the cart, you can create a [custom attribute with associated entity **cart item**](#set-the-value-of-an-attribute)
called <Attribute name="pizza" type="custom" /> and add values such as `pizza carbonara`, `pizza salami`, and `pizza veggie`,
or a list of SKUs.

When [Create a custom attribute](#create-a-custom-attribute), you can decide whether users
creating rules can add their own values or just pick predefined values from a list.

:::note
Picklist values are not available for **boolean** and **location** attributes.
:::

### Catalog-based picklist values

The <Attribute name="Product" type="builtin" /> and <Attribute name="SKU of item" type="builtin" />
of items in a [cart item catalog](/docs/product/account/dev-tools/manage-cart-item-catalogs.md)
are available as picklist values in all the Applications connected to the catalog.

The values of the catalog's custom attributes with associated entity
**cart item** and type **string** and **list of strings** are also available as picklist
values in all the Applications connected to the catalog.

## Set the value of an attribute

After you create an attribute, you can set its value. The way you can set its value
depends on the associated entity.

   EntityHow to set the attribute values
   
      
         ApplicationIn the Application settings.
      
      
         CampaignIn the settings of the campaign.
      
      
         Cart item
         
            Programmatically, using the Update customer session endpoint. See an example in the Developer docs.
            <Admonition type="note">Any attributes that you do not include in the list will be removed.</Admonition>
         
      
      
         Coupon
         When you create a coupon via the Campaign Manager. Programmatically during import or using the Update customer session endpoint.
      
      
         Customer profile
         Programmatically, using the Update customer profile endpoint.
      
      
         Customer session
         Programmatically, using the Update customer session endpoint.
      
      
         Event
         Programmatically, using the Track event endpoint.
      
      
         Giveaway
         When you import a giveaway. Programmatically, during import or using the Update customer session endpoint.
      
      
         Loyalty card
         When you create a loyalty card. Programmatically, using the Update loyalty card endpoint.
      
      
         Referral
         When you generate a referral as an effect. Programmatically, during creation or using the Update customer session endpoint.
      
      
         Store
         Programmatically, using the Create store endpoint for a new store and the Update store endpoint for an existing store.
      
   

Also see an example in the [Developer docs](/docs/dev/concepts/attributes.md).

## Display attributes

To display the available attributes, on the leftmost menu,
click <Account className="icon"/> **Account** > <Tools className="icon"/> **Tools** > **Attributes**.

The page displays the following information for each of the displayed attributes:

|   Column   |                                                      Description                                                       |     |
| ---------- | ---------------------------------------------------------------------------------------------------------------------- | --- |
| Attribute  | Name of the attribute displayed in the Rule Builder.                                                                   |     |
| API name   | Name of the attribute used in the integration layer.                                                                   |     |
| Entity     | [Entity](/docs/dev/concepts/entities/entities-overview.md) associated with the attribute.                              |     |
| Type       | Value type of the attribute, for instance, `string` or `number`.                                                       |     |
| Campaigns  | Number of active campaigns in which the attribute is used.                                                            |     |
| Visibility | Toggle button that allows you to control the visibility of attributes in the [Attribute Selector][attribute selector]. |     |

## Manage attribute visibility

Depending on your attribute usage, you can control the visibility of attributes
in the [Attribute Selector][attribute selector].
For example, you can hide outdated or irrelevant attributes to make finding attributes easier.

To manage attribute visibility:

1. On the leftmost menu, click <Account className="icon"/> **Account**.
1. Click <Tools className="icon"/> **Tools** > **Attributes**.
1. In the **Visibility** column, click to toggle the status for the required attribute:
   - **Enabled**: The attribute is visible, and you can select it in the Attribute Selector.
   - **Disabled**: The attribute is hidden. It appears in the search results of the
     Attribute Selector, but you cannot select it.

   :::note
   Hidden attributes still appear in the rules in which they are used.
   :::

## Edit a custom attribute

You can modify some characteristics of an attribute after it has been created. For example,
you can modify the description or edit picklist values.

:::important
Application admins can edit custom attributes that are available only in Applications of
which they are an admin.
:::

To edit a custom attribute:

1. On the leftmost menu, click <Account className="icon"/> **Account**.
1. Click <Tools className="icon"/> **Tools** > **Attributes**.
1. Use the search bar and the filters at the top to search for the required attribute.
1. Click the title of the attribute you want to edit.
1. Edit the required information, such as the name, description, picklist
   values, and connected Applications or loyalty programs.

   :::note
   If you [imported a CSV file with picklist values](#create-a-custom-attribute), you can
   download it to check the values it contains. If you import a new CSV file, it overrides
   any manually entered values and previous imports.
   :::

1. Click **Update attribute**.

## Delete a custom attribute

You can delete your custom attributes but not the built-in ones.

:::important

- Deleting a custom attribute can break your integration with Talon.One. Before deleting
  an attribute, ensure it is not being used in your API requests. If you are not sure,
  contact your development team for details or consider [hiding the attribute](/docs/product/account/dev-tools/manage-attributes.md#manage-attribute-visibility) instead.
- You cannot delete a custom attribute if you are using it.
- Application admins can delete custom attributes that are available only in Applications
  of which they are an admin.

:::

To delete a custom attribute:

1. On the leftmost menu, click <Account className="icon"/> **Account**.
1. Click <Tools className="icon"/> **Tools** > **Attributes**.
1. Use the search bar and the filters at the top to search for the required attribute.
1. Click the title of the attribute you want to delete.
1. At the bottom of the page, click **Delete Attribute**.
1. On the confirmation window that appears, enter the **API name** of the attribute and
   click <Delete className="icon"/> **Delete Attribute**.

## Related pages

- [Make attributes mandatory](/docs/product/applications/use-attributes.md#make-attributes-mandatory)
- [Add custom attributes to an Application](/docs/product/applications/use-attributes.md#add-custom-attributes-to-an-application)
- [Manage cart item catalogs](/docs/product/account/dev-tools/manage-cart-item-catalogs.md)
- [Attribute Selector][attribute selector]

[attribute selector]: /docs/product/rules/overview.md#attribute-selector
[rule builder]: /docs/product/rules/overview.md
