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.
Field | Values | Definition |
---|---|---|
field | String. Valid value: type . | The field to filter |
eq | String. 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)
Field | Values | Required? | Description |
---|---|---|---|
name | String | Optional | The name of the reference set |
dataSetId | ID | Required | The ID of the reference set (assigned automatically) |
type | String | Optional | The 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.
Field | Values | Definition |
---|---|---|
field | String. Valid values: - type - dataSetId | The field to use for filtering |
eq | - For the type field, useREFERENCE_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)
Field | Values | Required? | Description |
---|---|---|---|
associations | Array of objects | Optional | If there are reference sets linked to the current reference set, you will get a separate object for each of them. |
attributes | Array of objects | Optional | Returns a separate object for each attribute in the reference set |
Fields supported by objects within the associations
field
Field | Nested field | Required? | Definition |
---|---|---|---|
to | dataSetId | Optional | The ID of the reference set connected to the current reference set |
name | Optional | The name of the reference set connected to the current reference set | |
mappings | fromAttribute | Optional | The attribute in the current reference set linking to the target reference set |
toAttribute | Optional | The attribute in the target reference linking to the current reference set |
Fields supported by objects within the attributes
field
Field | Nested field | Values | Required? | Definition |
---|---|---|---|---|
decimalPrecision | Integer | Optional | The number of decimal places after the separator. Applies to numeric attributes. | |
identifyAs | key | Boolean | Optional | If the value is true for a column, it means this is the key column in the reference set. |
name | String | Required | The name of the attribute | |
type | One of the following values: - TEXT - NUMBER - BOOLEAN - DATE | Optional | The data format of the attribute |