---
schema_version: "1"
id: 235e5d1cf432c4f49199faa50fbf768c3e313711b4f85da697b9cd6e5009166e
title: Composite Key
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_composite_key.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_composite_key.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e6d9c57e5f0a40fd4aaf124c6a5c298fdeee420e9eb6ad882250c039125f756d
description: Use a composite key to uniquely identify a record.
products:
  - Data 360
release: "264"
---
# Composite Key

Use a composite key to uniquely identify a record.

In Data Cloud, you can assign composite keys only for Bring Your Own Lake (BYOL) data shares. To assign a composite key, use one of these options.

- Search for and select the appropriate fields in the data source table to designate as a composite key.
    
    ![Composite key using clicks to select multiple fields.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/data_cloud/images/Composite_Key_Multiple_Fields.png)
- In cases where the data source table has an existing primary key or not all rows have unique values, use the [formula field](https://help.salesforce.com/s/articleView?id=data.c360_a_formula_expression_library.htm&type=5&language=en_US) to define a formula that can combine two or more source fields to generate a composite key.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_note.png)
    
    Note A formula is ideal for file-based data sources such as Amazon S3, Google Cloud Storage, Microsoft Azure, and Secure File Transfer (STFP).
    
    For example, in this Sales Order Detail database, not all rows have unique values. By combining the Order ID and SKU fields, you can use a formula to generate a composite key and configure it as the primary key for your data source.
    
    ![Composite key example data](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/data_cloud/images/CompositeKey1.png)
    
    Use the formula field functionality to define a formula that can transform your fields to provide a composite key.
    
    ![Composite key example formula.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/data_cloud/images/Formula_Field.png)
    
    After you create the formula field “OrderID\_SKU\_Composite”, it can be configured as the primary key for your data source.
    
    ![Composite key selection using a primary key.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/data_cloud/images/CompositeKey3.png)