columnDefinition resource type

Namespace: microsoft.graph

Represents a column in a site, list, or contentType.

ColumnDefinitions and field values for hidden columns aren't shown by default. To list hidden columnDefinitions, include hidden in your $select statement. To list hidden field values on listItems, include the desired columns by name in your $select statement.

Methods

Method Return type Description
List columns in a site columnDefinition collection Get a list of the columnDefinition objects and their properties in a site.
List columns in a list columnDefinition collection Get a list of the columnDefinition objects and their properties in a list.
List columns in a content type columnDefinition collection Get a list of the columnDefinition objects and their properties in a content type.
Create columnDefinition for a site columnDefinition Create a new columnDefinition object in a site.
Create columnDefinition for a list columnDefinition Create a new columnDefinition object in a list.
Create columnDefinition for a content type columnDefinition Create a new columnDefinition object in a content type.
Get columnDefinition columnDefinition Read the properties and relationships of a columnDefinition object.
Update columnDefinition columnDefinition Update the properties of a columnDefinition object.
Delete columnDefinition None Deletes a columnDefinition object.

Properties

Columns can hold data of various types. The following properties indicate what type of data a column stores, as well as additional settings for that data. The type-related properties (boolean, calculated, choice, currency, dateTime, lookup, number, personOrGroup, text, term, hyperlinkOrPicture, thumbnail, and contentApprovalStatus) are mutually exclusive; a column can only have one of them specified.

Property name Type Description
columnGroup string For site columns, the name of the group this column belongs to. Helps organize related columns.
description string The user-facing description of the column.
displayName string The user-facing name of the column.
enforceUniqueValues Boolean If true, no two list items may have the same value for this column.
hidden Boolean Specifies whether the column is displayed in the user interface.
id string The unique identifier for the column.
indexed Boolean Specifies whether the column values can be used for sorting and searching.
name string The API-facing name of the column as it appears in the fields on a listItem. For the user-facing name, see displayName.
readOnly Boolean Specifies whether the column values can be modified.
required Boolean Specifies whether the column value isn't optional.
boolean booleanColumn This column stores boolean values.
calculated calculatedColumn This column's data is calculated based on other columns.
choice choiceColumn This column stores data from a list of choices.
currency currencyColumn This column stores currency values.
dateTime dateTimeColumn This column stores DateTime values.
defaultValue defaultColumnValue The default value for this column.
geolocation geolocationColumn This column stores a geolocation.
lookup lookupColumn This column's data is looked up from another source in the site.
number numberColumn This column stores number values.
personOrGroup personOrGroupColumn This column stores Person or Group values.
text textColumn This column stores text values.
isDeletable Boolean Indicates whether this column can be deleted.
propagateChanges Boolean If 'true', changes to this column will be propagated to lists that implement the column.
isReorderable Boolean Indicates whether values in the column can be reordered. Read-only.
isSealed Boolean Specifies whether the column can be changed.
validation columnValidation This column stores validation formula and message for the column.
hyperlinkOrPicture hyperlinkOrPictureColumn This column stores hyperlink or picture values.
term termColumn This column stores taxonomy terms.
sourceContentType contentTypeInfo ContentType from which this column is inherited from. Present only in contentTypes columns response. Read-only.
thumbnail thumbnailColumn This column stores thumbnail values.
type columnTypes For site columns, the type of column. Read-only.
contentApprovalStatus contentApprovalStatusColumn This column stores content approval status.

Relationships

Property name Type Description
sourceColumn columnDefinition The source column for the content type column.

Note: These properties correspond to the SharePoint SPFieldType enumeration. Note that the most common field types are represented in the previous table. However, this API is still missing some. In those cases, none of the column type facets will be populated, and the column will only have its basic properties. Sites and list columns response won't contain isDeletable, propagateChanges, isReorderable, isSealed, validation, hyperlinkOrPicture, term, sourceContentType, thumbnail, type, contentApprovalStatus, and sourceColumn properties.

JSON representation

Here is a JSON representation of a columnDefinition resource.

{
  "columnGroup": "string",
  "description": "description",
  "displayName": "friendly name",
  "enforceUniqueValues": true,
  "hidden": false,
  "id": "string",
  "indexed": true,
  "name": "staticNameForApi",
  "readOnly": false,
  "required": false,
  "boolean": { "@odata.type": "microsoft.graph.booleanColumn" },
  "calculated": { "@odata.type": "microsoft.graph.calculatedColumn" },
  "choice": { "@odata.type": "microsoft.graph.choiceColumn" },
  "currency": { "@odata.type": "microsoft.graph.currencyColumn" },
  "dateTime": { "@odata.type": "microsoft.graph.dateTimeColumn" },
  "defaultValue": { "@odata.type": "microsoft.graph.defaultColumnValue" },
  "geolocation": { "@odata.type": "microsoft.graph.geolocationColumn" },
  "lookup": { "@odata.type": "microsoft.graph.lookupColumn" },
  "number": { "@odata.type": "microsoft.graph.numberColumn" },
  "personOrGroup": { "@odata.type": "microsoft.graph.personOrGroupColumn" },
  "text": { "@odata.type": "microsoft.graph.textColumn" },
  "isDeletable" : false,
  "propagateChanges": false,
  "isReorderable": false,
  "isSealed": false,
  "validation": { "@odata.type": "microsoft.graph.columnValidation" },
  "hyperlinkOrPicture": { "@odata.type": "microsoft.graph.hyperlinkOrPictureColumn" },
  "term": { "@odata.type": "microsoft.graph.termColumn" },
  "sourceContentType": { "@odata.type": "microsoft.graph.contentTypeInfo" },
  "thumbnail": { "@odata.type": "microsoft.graph.thumbnailColumn" },
  "type": { "@odata.type": "microsoft.graph.columnTypes" },
  "contentApprovalStatus": { "@odata.type": "microsoft.graph.contentApprovalStatusColumn" }
}