Assign a contact attribute to another category

To assign a contact attribute to another category or to reset the current category selection, use the updateDataSet mutation.

mutation {
  updateDataSet(
    where: { dataSetId: "4fe4136f-c007-44a3-b38f-92220xxxxxxxx" }
    to: {
      attributes: {
        update: [
          { name: "iPhone user", category: "Demographic" }
          { name: "First Name", category: "Contact information" }
        ]
      }
    }
  ) {
    dataSetId
    dataJobId
  }
}
{
  "data": {
    "updateDataSet": {
      "dataSetId": "4fe4136f-c007-44a3-b38f-92220xxxxxxxx",
      "dataJobId": null
    }
  }
}

A non-null dataJobId means the change hasn't been applied yet. Poll the data job to confirm completion.

Arguments

Arguments required by the updateDataSet object

ArgumentNested fieldValuesDefinition
wheredataSetIdIDThe ID of your audience
toattributesSee nested fieldsThe changes you want to make

Fields nested inside attributes. Only name is required.

FieldNested fieldValuesDefinition
updatenameString (case-sensitive)The name of the contact attribute to update
category

String

To reset the current category, submit the null value.

The name of a new category for the contact attribute.

Use the Get all categories of contact attributes query to get the list of supported values.

mapAsEnumeration. Valid values: FIRST_NAME, LAST_NAME.Maps the attribute to a standard personalization field.

Fields

Fields returned by the updateDataSet mutation

FieldValuesRequired?Definition
dataSetIdIDRequiredThe ID of the audience
dataJobIdIDOptionalA non-null dataJobId means the change hasn't been applied yet. Poll the data job to confirm completion.

Possible error messages

Error codeDefinition
ATTRIBUTE_NOT_DEFINEDThere is no contact attribute with this name in the current audience.