To get information about the reference sets in your Connect subscription, use the dataSets object.

Getting all reference sets

Here is how to get the list of all reference sets in your Connect subscription.

query  {
  dataSets(filter: [{ field: "type", eq: "REFERENCE_SET" }]) {
    nodes {
      name
      dataSetId
      type
    }
  }
}
{
  "data": {
    "dataSets": {
      "nodes": [
        {
          "name": "Physical store clients",
          "dataSetId": "e83a688c-e53e-4a1c-8565-0000000001",
          "type": "REFERENCE_SET"
        },
        {
          "name": "Coupons",
          "dataSetId": "90f06be3-e617-4dff-b1ca-0000000000001",
          "type": "REFERENCE_SET"
        },
        {
          "name": "Store locations",
          "dataSetId": "271ae741-84b4-429d-abd4-0000000000003",
          "type": "REFERENCE_SET"
        },
        {
          "name": "Order History",
          "dataSetId": "0108995f-317c-43b7-b905-0000000000000",
          "type": "REFERENCE_SET"
        }
      ]
    }
  }
}

⚠️ This query only returns meta data. For content, see Get reference set content.

Arguments

Add the filter argument to your query. It must contain an object with the following fields.

⚠️If you omit this filter, the response will contain the audience in addition to the reference sets.

FieldValuesDefinition
fieldString. Valid value: type.The field to filter
eqString. Valid value:
REFERENCE_SET.
The value that the specified field must be equal to.

Fields

Fields returned by the dataSets query (all of them are nested into the nodes field)

FieldValuesRequired?Description
nameStringOptionalThe name of the reference set
dataSetIdIDRequiredThe ID of the reference set (assigned automatically)
typeStringOptionalThe type of the dataset

Getting a reference set by ID

If you have the ID of a reference set, you can get the reference sets linked to it and the attributes it contains.

query {
  dataSets(
    filter: [
      { field: "type", eq: "REFERENCE_SET" }
      { field: "dataSetId", eq: "90f06be3-e617-4dff-b1ca-0000000000001" }
    ]
  ) {
    nodes {
      associations {
        to {
          dataSetId
          name
        }
        mappings {
          fromAttribute
          toAttribute
        }
      }
      attributes {
        name
        type
        identifyAs {
          key
        }
      }
    }
  }
}
{
  "data": {
    "dataSets": {
      "nodes": [
        {
          "associations": [
            {
              "to": {
                "dataSetId": "271ae741-84b4-429d-abd4-0000000000003",
                "name": "Coupons"
              },
              "mappings": [
                {
                  "fromAttribute": "Coupon",
                  "toAttribute": "Coupon ID"
                }
              ]
            }
          ],
          "attributes": [
            {
              "name": "Client ID",
              "type": "TEXT",
              "identifyAs": {
                "channels": null,
                "key": true
              }
            },
            {
              "name": "Order ID",
              "type": "TEXT",
              "identifyAs": null
            },
            {
              "name": "Amount",
              "type": "NUMBER",
              "identifyAs": null
            },
            {
              "name": "Date",
              "type": "DATE",
              "identifyAs": null
            },
            {
              "name": "First-time purchase",
              "type": "BOOLEAN",
              "identifyAs": null
            },
            {
              "name": "Discount coupon",
              "type": "TEXT",
              "identifyAs": null
            }
          ]
        }
      ]
    }
  }
}

Arguments

Add the filter argument to your query. It's an array of objects. There must be 2 objects with filtering conditions inside: dataset type and dataset ID.

⚠️If you omit this filter, the response will contain the audience in addition to the reference sets.

FieldValuesDefinition
fieldString. Valid values:

- type
- dataSetId
The field to use for filtering
eq- For the type field, use
REFERENCE_SET
- For the dataSetId field, use the ID of the reference set.
The value that the specified field must be equal to

Fields

Fields returned by the dataSets query (all of them are nested into the nodes field)

FieldValuesRequired?Description
associationsArray of objectsOptionalIf there are reference sets linked to the current reference set, you will get a separate object for each of them.
attributesArray of objectsOptionalReturns a separate object for each attribute in the reference set

Fields supported by objects within the associations field

FieldNested fieldRequired?Definition
todataSetIdOptionalThe ID of the reference set connected to the current reference set
nameOptionalThe name of the reference set connected to the current reference set
mappingsfromAttributeOptionalThe attribute in the current reference set linking to the target reference set
toAttributeOptionalThe attribute in the target reference linking to the current reference set

Fields supported by objects within the attributes field

FieldNested fieldValuesRequired?Definition
decimalPrecisionIntegerOptional The number of decimal places after the separator. Applies to numeric attributes.
identifyAskeyBooleanOptional If the value is true for a column, it means this is the key column in the reference set.
nameStringRequiredThe name of the attribute
typeOne of the following values:

- TEXT
- NUMBER
- BOOLEAN
- DATE
Optional The data format of the attribute