# Data Catalog Properties


This guide walks you through creating and managing your properties in the Data Catalog.

## Required permissions

- [Admins]({{< ref "access-management/member-management.md#member-roles" >}}) have full access to manage event properties in the Data Catalog.
- [Members]({{< ref "access-management/member-management.md#member-roles" >}}) must have the following [permission]({{< ref "access-management/policies-overview.md#resource-permissions" >}}) in their workspace policy:

| Resource | Permission | <div style="width:400px">Description</div> |
| :----| :-----| :----|
| Data Catalog | **Edit** | Make changes to the configuration of Data Catalog |

{{< details "**Click here to see how these permissions appear in the workspace policy**." >}}
<br />

{{< figure src="images/access-management/data-catalog-permissions.webp" alt="Data Catalog permissions to manage properties" >}}

{{< /details >}}
<br />

#### Permissions for legacy RBAC system

In the [legacy Permissions Management (RBAC) system]({{< ref "archive/dashboard-guides/user-management.md" >}}):

- [Org Admins]({{< ref "archive/dashboard-guides/user-management.md#organization-roles" >}}) have full access to manage the Data Catalog
- Members must have the **Connections Admin** role in their workspace policy to manage the Data Catalog

{{< image src="images/access-management/tracking-plan-permissions-legacy-framework.webp" alt="Data Catalog permissions in the legacy framework" >}}

## Add property

RudderStack provides two ways of creating and adding properties to your Data Catalog:

- [In the Data Catalog itself](#in-data-catalog)
- [While editing your tracking plan](#while-editing-a-tracking-plan)

### In Data Catalog

1. Log in to the [RudderStack dashboard](https://app.rudderstack.com/) and go to **Govern** > **Data Catalog** option in the left sidebar.
2. Go to the **Properties** tab, click **Add property**.

{{< image src="images/data-governance/data-catalog-add-property.webp" alt="Add new property" >}}

3. In the **Property details** tab, specify the property name and description.

{{< info >}}
Note that:

- You cannot set a blank property name - it must be at least 1 character long.
- RudderStack supports all the UTF-8 characters in property names.
- The property name can start with a letter, number, or special character. Some examples of valid property names:
  
  - `test_property`
  - `1test_property`
  - `@1Ttest property`
{{< /info >}}

4. Choose the data type for your property from the dropdown. You can also:

    - Choose multiple data types as per your requirement.
    - Leave this field empty to accept any data type.
    - Select a [custom data type](#custom-data-types) for the property.

{{< image src="images/data-governance/add-new-property-to-catalog.webp" alt="Add new property to catalog" >}}

5. If you choose **Array** from the dropdown, select the data type of its elements in the **Array of** field . For example, if you choose **String**, RudderStack accepts only string elements for that array.

{{< image src="images/data-governance/array-property-type.webp" alt="Array property type" >}}

6. Click **Save** to save the changes and add the new property to your Data Catalog.

### While editing a tracking plan

You can also create a new property while [adding a new event schema]({{< ref "data-governance/tracking-plans/view-edit-tracking-plans.md#add-a-new-event-schema" >}}) or [updating an existing event schema]({{< ref "data-governance/tracking-plans/view-edit-tracking-plans.md#update-an-existing-event-schema" >}}) for your tracking plan.

1. Go to **Govern** > **Tracking Plans** to see all the tracking plans in your workspace. Then, click a tracking plan.
2. Click the meatballs menu (`...`) next to an event and click **Edit event schema**.
3.  Click the **Add properties** button.

{{< image src="images/data-governance/tracking-plans/add-properties.webp" alt="Add new property" >}}

4. In the right panel, click **Create new property**.
5. Specify the property name, description, and data type.
6. Click **Create property**.

{{< image src="images/data-governance/tracking-plans/create-new-property.webp" alt="Create new property" >}}

### Add multiple properties with the same name

You can create multiple properties with the same name as long as:

- They have a different data type, OR
- In case of arrays, they have different **Array of** values. For example, if you create a property called `test_property` of the array data type and the **Array of** field set to **String**, as shown:

{{< image src="images/data-governance/multiple-properties-name.webp" alt="Add multiple properties with same name" >}}

In that case:

- You can create another property called `test_property` with a different data type, for example, Integer.
- You can create another property called `test_property` with an array data type and a different **Array of** field setting, for example, Boolean and String.
- You **cannot** create another property called `test_property` with an array data type and the **Array of** field set to String.

## Property details

Once created, you can click the property to see the following information:

- Property details like name, description, and data type. You can also make any changes to these details - make sure to click **Save** for any changes to take effect.
- Connections to tracking plans, along with the connected sources and associated events (only visible after you map the property to an event while creating a tracking plan).
- Delete property from Data Catalog. Note that you **cannot** delete any property from the catalog if it is already a part of any tracking plan.

{{< image src="images/data-governance/view-property.webp" alt="Add new property" >}}

## Set advanced rules for a property

While adding or editing a property, use the **Advanced rules** tab to add rules that define how RudderStack should capture a property.

{{< info >}}
You can set advanced rules for properties of all the data types except **Object** and **Null**.
{{< /info >}}

You can define the following advanced rules for the property depending on its data type:

{{< tabs tabTotal="4" >}}
{{% tab tabName="String" %}}

- **Enum**: Define the acceptable values for the property.

{{< figure src="images/data-governance/advanced-rules-enum.webp" alt="Define the acceptable values for the property" >}}

- **Format**: Define the acceptable format in which the property values should be captured. RudderStack supports the below formats:

  - date-time
  - date
  - time
  - email
  - hostname
  - ipv4
  - ipv6
  - uuid

{{< figure src="images/data-governance/advanced-rules-format.webp" alt="Define the property format" >}}

- **Pattern**: Define the property constraints using regular expressions. RudderStack supports the below patterns:

  - Email
  - Date-time (`YYYY-MM-DDTHH:MM:SS`)
  - Date (`YYYY-MM-DD`)
  - Time (`HH:MM:SS`)
  - URL
  - IPv4
  - IPv6
  - Custom (define a custom pattern)

{{< figure src="images/data-governance/advanced-rules-pattern.webp" alt="Define the property constraints via patterns" >}}

- **Minimum/maximum length**: Define the acceptable string length for the property.

{{< figure src="images/data-governance/advanced-rules-length.webp" alt="Define the property string length" >}}

{{% /tab %}}
{{% tab tabName="Integer / Number" %}}

- **Enum**: Define the acceptable values for the property.

{{< figure src="images/data-governance/advanced-rules-num-enum.webp" alt="Define the acceptable values for the property" >}}

- **Minimum/Maximum**: Define the range acceptable for the property. 

{{< figure src="images/data-governance/advanced-rules-minmax.webp" alt="Define the min/max range for the property" >}}

- **Exclusive Minimum/Maximum**: Define the exclusive range acceptable for the property. 

{{< figure src="images/data-governance/advanced-rules-excl-minmax.webp" alt="Define the acceptable exclusive min/max range for the property" >}}

- **Multiple Of**: Define a number whose multiples are the only acceptable values for this property.

{{< figure src="images/data-governance/advanced-rules-multipleof.webp" alt="Define the acceptable multiples for the property" >}}

{{% /tab %}}
{{% tab tabName="Array" %}}

- **Minimum/Maximum items**: Define the minimum and maximum number of items acceptable for this property.

{{< figure src="images/data-governance/advanced-rules-minmax-array.webp" alt="Define the acceptable number of items for the property" >}}

- **Unique items**: Specify whether RudderStack should accept arrays with only unique items. To do so, turn on the **Allow unique items** toggle.

{{< figure src="images/data-governance/advanced-rules-unique.webp" alt="Define unique items setting for the property" >}}

{{% /tab %}}
{{% tab tabName="Boolean" %}}

- **Enum**: Define the acceptable values for the property.

{{< figure src="images/data-governance/advanced-rules-enum.webp" alt="Define the acceptable values for the property" >}}

{{% /tab %}}
{{< /tabs >}}

## Custom data types

{{< announcement >}}
The **Custom data types** feature is in **Private Beta**, where we work with early users and customers to test new features and get feedback before making them generally available.

Reach out to [Customer Success](mailto:support@rudderstack.com) if you are interested in enabling this feature for your workspace.
{{< /announcement >}}

{{< youtube WEY5q5KaPXo >}}<br />

You can use the **Custom Data Types** tab to set predefined [rules](#advanced-rules) and later apply them to multiple event properties as per your requirement. With this approach, you can avoid setting the same set of advanced rules to each property individually.

This section highlights the steps for adding a custom type in your Data Catalog and then defining a new property to use that custom type.

### Define custom types

1. Go to the **Properties** tab of the Data Catalog and click the **Custom Data Types (beta)** tab. Then, click **Add custom type**.

{{< image src="images/data-governance/add-custom-type.webp" alt="Add custom data type" >}}

2. Specify the name, description, and data type under **Type details**:

{{< warning >}}
The custom type name must be between 2 and 65 characters long. Also, it must start with a capital letter and contain only letters, numbers, underscores and dashes. Spaces are **not** allowed.
{{< /warning >}}

{{< image src="images/data-governance/define-custom-type.webp" alt="Define custom type" >}}

3. Go to the **Rules** tab and define the rules for the data type selected above. An example for a string is shown below:

{{< image src="images/data-governance/define-custom-type-rules.webp" alt="Define custom type rules" >}}

4. Click **Save** to save the changes.

### Examples

This section highlights some specific use cases of creating new custom types in your Data Catalog.

#### Create a custom type that is an array of other custom types

You can create a custom type that is an array of another custom type, that is, it accepts only a list of that custom type.

1. Specify the name and description (optional) of the custom type.
2. Under **Type**, select **Array**.
3. Under **Array of**, select **Custom data type (beta)**.
4. Select the required **Custom data type**.
5. Specify the rules for this new array custom type, as required.

The following image highlights a custom type named `ArrayCustomType` that is an array of another custom type `StringCustomType`.

{{< image src="images/data-governance/new-custom-type-array.webp" alt="Define array of custom types" >}}

Note that you can specify **only one** custom type in the **Array of** field, as seen in the above image.

#### Create an object custom type that accepts specific properties

You can create a custom data type of object type that **only accepts** specific properties present in your Data Catalog:

1. Specify the name and description (optional) of the custom type.
2. Under **Type**, select **Object**.
3. Select the required properties present in your Data Catalog in the **Properties** field.
4. Mark the properties as **Optional** or **Required**, as per your requirement.

{{< image src="images/data-governance/object-custom-type.webp" alt="Define object custom type" >}}

### Create new properties using custom types

1. In the **Properties** tab of the Data Catalog, click **Add property**.

{{< image src="images/data-governance/data-catalog-add-property.webp" alt="Add new property" >}}

2. Enter the property name and description. 
3. Under **Data type**, select **Custom data type (beta)**. Then, select the custom data type defined in [Step 1](#step-1-define-custom-types) above.

{{< image src="images/data-governance/add-property-data-type.webp" alt="Select custom data type for property" >}}

Once you select the custom data type, the property automatically inherits all the rules that you defined while creating the custom data type.

{{< image src="images/data-governance/add-property-custom-type-details.webp" alt="Custom data type applied property" >}}

#### Create a property that accepts an array of a custom type

You can create a new property that accepts an array of a custom data type.

1. Specify the property name and description (optional).
2. Choose **Data type** as **Array**.
3. Set the **Array of** field to **Custom data type (beta)**.
4. Select the required **Custom data type**.
5. Set the **Property rules**, as required.

The following image highlights a new property called `products_array` that is an array of a custom type `StringCustomType`:

{{< image src="images/data-governance/array-custom-type.webp" alt="Define array of custom data type" >}}
