Connect reference sets

To start taking advantage of the data in your reference sets, you must connect them to your audience and — if necessary — to each other.

In the example below, we map the Last Order ID audience attribute to the ID attribute in the Order History reference set. This will enable Connect to pull order details for each client.

mutation {
  addReferenceSetAssociation(
    dataSetAssociation: {
      to: "b4fc145e-680a-4fc6-9d7a-00000000001"
      from: "a7c170d2-51d5-4c86-9a28-000000au1"
      mappings: { toAttribute: "ID", fromAttribute: "Last Order ID" }
    }
  ) {
    to {
      name
      dataSetId
      type
    }
    from {
      name
      dataSetId
      type
    }
  }
}
{
  "data": {
    "addReferenceSetAssociation": {
      "to": {
        "name": "Order history",
        "dataSetId": "b4fc145e-680a-4fc6-9d7a-00000000001",
        "type": "REFERENCE_SET"
      },
      "from": {
        "name": "Marketing",
        "dataSetId": "a7c170d2-51d5-4c86-9a28-000000au1",
        "type": "AUDIENCE"
      }
    }
  }
}

How it works

  • You can connect the audience to a reference set that is connected to another reference set. Unlike the audience, reference sets support only one-level connections.
  • Connections are established based on a common attribute. The source and destination attributes must be of the same type (for example, text/text or date/date). To learn more about the options, see our marketing guide - Create connections.

Running the mutation

If you haven't used our API before, see Using the Connect API for instructions. It explains how to authenticate your calls and suggests some tools for testing.

Mutation structure

Arguments

The addReferenceSetAssociation mutation has the dataSetAssociation argument at the top level. Here are the input fields supported by the argument. All of them are required.

FieldNested fieldValuesDefinition
toIDThe ID of the target data set
fromIDThe ID of the source data set.

⚠️If you are connecting a resource set to the audience, the audience is always the source data set. It cannot be a target data set.
mappingstoAttributeStringThe attribute in the target data set to use for mapping
fromAttributeStringThe attribute in the source data set to use for mapping

Fields

Fields returned by the addReferenceSetAssociation mutation

FieldNested fieldValuesRequired?Definition
todataSetIdIDRequiredThe ID of the target data set
nameStringOptional The name of the target data set
typeEnumeration. Valid values:

- AUDIENCE
- REFERENCE_SET
Optional The type of the target data set
fromdataSetIdIDRequiredThe ID of the source data set
nameStringOptionalThe name of the source data set
typeEnumeration. Valid values:

- AUDIENCE
- REFERENCE_SET
OptionalThe type of the source data set