編輯

共用方式為


columnDefinition resource type

Namespace: microsoft.graph

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

By default, columnDefinitions and field values for hidden columns aren't shown. 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 Delete 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
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.
columnGroup string For site columns, the name of the group this column belongs to. Helps organize related columns.
contentApprovalStatus contentApprovalStatusColumn This column stores content approval status.
currency currencyColumn This column stores currency values.
dateTime dateTimeColumn This column stores DateTime values.
defaultValue defaultColumnValue The default value for this column.
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.
geolocation geolocationColumn This column stores a geolocation.
hidden Boolean Specifies whether the column is displayed in the user interface.
hyperlinkOrPicture hyperlinkOrPictureColumn This column stores hyperlink or picture values.
isDeletable Boolean Indicates whether this column can be deleted.
isReorderable Boolean Indicates whether values in the column can be reordered. Read-only.
id string The unique identifier for the column.
indexed Boolean Specifies whether the column values can be used for sorting and searching.
isSealed Boolean Specifies whether the column can be changed.
lookup lookupColumn This column's data is looked up from another source in the site.
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.
number numberColumn This column stores number values.
personOrGroup personOrGroupColumn This column stores Person or Group values.
propagateChanges Boolean If 'true', changes to this column will be propagated to lists that implement the column.
readOnly Boolean Specifies whether the column values can be modified.
required Boolean Specifies whether the column value isn't optional.
sourceContentType contentTypeInfo ContentType from which this column is inherited from. Present only in contentTypes columns response. Read-only.
term termColumn This column stores taxonomy terms.
text textColumn This column stores text values.
thumbnail thumbnailColumn This column stores thumbnail values.
type columnTypes For site columns, the type of column. Read-only.
validation columnValidation This column stores validation formula and message for the column.

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

The following JSON representation shows the resource type.

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