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

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.

To establish any of these connections, use the addReferenceSetAssociation object.

mutation {
  addReferenceSetAssociation(
    dataSetAssociation: {
      to: "b4fc145e-680a-4fc6-9d7a-00000000001"
      from: "a7c170d2-51d5-4c86-9a28-000000au1"
      mappings: { toAttribute: "ID", fromAttribute: "Unique ID" }
    }
  ) {
    to {
      dataSetId
      name
    }
    from {
      dataSetId 
      name 
    }
  }
}
{
  "data": {
    "addReferenceSetAssociation": {
      "to": {
        "dataSetId": "b4fc145e-680a-4fc6-9d7a-00000000001",
        "name": "Focus group participants"
      },
      "from": {
        "dataSetId": "a7c170d2-51d5-4c86-9a28-000000au1",
        "name": "Green store"
      }
    }
  }
}

Arguments

Arguments supported by the addReferenceSetAssociation mutation

ArgumentNested field - level 1Nested field - level 2ValuesRequired?Definition
dataSetAssociationtoIDRequiredThe ID of the target reference set
fromIDRequiredThe 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.
mappingstoAttributeStringRequiredThe name of the key attribute in the reference set (it will be used for mapping)
fromAttributeStringRequiredThe name of the attribute that the reference set will be mapped to

Fields

Fields returned by the addReferenceSetAssociation mutation

FieldNested field - level 1Definition
todataSetIdThe ID of the target data set
nameThe name of the target data set
fromdataSetIdThe ID of the source data set
nameThe name of the source data set