Table of Contents

Interface IField

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

Public interface to define a Field object of SharePoint Online

public interface IField : IDataModel<IField>, IDataModelParent, IDataModelWithContext, ISupportModules<IField>, IDataModelGet<IField>, IDataModelLoad<IField>, IDataModelUpdate, IDataModelDelete, IQueryableDataModel
Inherited Members
Extension Methods

Properties

All

A special property used to add an asterisk to a $select statement

object All { get; }

Property Value

object

AllowDisplay

Gets or sets whether to allow display if the user name

bool AllowDisplay { get; set; }

Property Value

bool

Gets or sets a value that specifies whether a hyperlink is allowed as a value of the field.

bool AllowHyperlink { get; set; }

Property Value

bool

AllowMultipleValues

Gets or sets whether the lookup fields allows multiple values

bool AllowMultipleValues { get; set; }

Property Value

bool

AnchorId

Gets or sets the GUID of the anchor Term object for a TaxonomyField

Guid AnchorId { get; set; }

Property Value

Guid

AppendOnly

Gets or sets a value that specifies whether all changes to the value of the field are displayed in list forms.

bool AppendOnly { get; set; }

Property Value

bool

AutoIndexed

Gets or sets a Boolean value that specifies whether the field is auto-indexed

bool AutoIndexed { get; set; }

Property Value

bool

CanBeDeleted

Specifies whether or not the field can be deleted

bool CanBeDeleted { get; }

Property Value

bool

Choices

Gets or sets the choices of choice field

string[] Choices { get; set; }

Property Value

string[]

ClientSideComponentId

Gets or Sets the client side component Id associated with the field

Guid ClientSideComponentId { get; set; }

Property Value

Guid

ClientSideComponentProperties

Gets or Sets the properties of the client side component associated with the field

string ClientSideComponentProperties { get; set; }

Property Value

string

ClientValidationFormula

Gets or Sets the validation formula

string ClientValidationFormula { get; set; }

Property Value

string

ClientValidationMessage

Gets or Sets the client validation message of the field

string ClientValidationMessage { get; set; }

Property Value

string

CreateValuesInEditForm

Gets or sets a Boolean value that specifies whether the new Term objects can be added to the TermSet while typing in the TaxonomyField editor control.

bool CreateValuesInEditForm { get; set; }

Property Value

bool

CurrencyLocaleId

Gets or Sets the Locale Id of the currency

int CurrencyLocaleId { get; set; }

Property Value

int

CustomFormatter

Gets or Sets custom formatter of the field

string CustomFormatter { get; set; }

Property Value

string

DateFormat

Gets or Sets the Date Format Valid for DateTime field, Calculated field

DateTimeFieldFormatType DateFormat { get; set; }

Property Value

DateTimeFieldFormatType

DateTimeCalendarType

Gets or sets the type of calendar to use of a DateTime field

CalendarType DateTimeCalendarType { get; set; }

Property Value

CalendarType

DefaultFormula

Gets or sets the default formula for a calculated field

string DefaultFormula { get; set; }

Property Value

string

DefaultValue

Gets or Sets the default value of the field

object DefaultValue { get; set; }

Property Value

object

DependentLookupInternalNames

Gets the dependent lookup internal names of a lookup field

string[] DependentLookupInternalNames { get; }

Property Value

string[]

Description

Gets or Sets the description of the field

string Description { get; set; }

Property Value

string

Direction

Specifies the direction of the reading order for the field. A string that contains LTR if the reading order is left-to-right, RTL if it is right-to-left or none

string Direction { get; set; }

Property Value

string

DisplayFormat

Gets or Sets the display format of the field CAUTION: Is an integer value since according to field type, the display format enum may change

int DisplayFormat { get; set; }

Property Value

int

EditFormat

Determines whether to display the choice field as radio buttons or as a drop-down list

ChoiceFormatType EditFormat { get; set; }

Property Value

ChoiceFormatType

EnableLookup

Gets or sets whether the lookup should be enabled for computed field

bool EnableLookup { get; set; }

Property Value

bool

EnforceUniqueValues

Gets or Sets whether the field enforces unique values

bool EnforceUniqueValues { get; set; }

Property Value

bool

EntityPropertyName

Gets the name of the entity property for the list item entity that uses this field

string EntityPropertyName { get; }

Property Value

string

FieldTypeKind

FieldType FieldTypeKind { get; }

Property Value

FieldType

FillInChoice

Gets or sets whether choice field can be filled in by user

bool FillInChoice { get; set; }

Property Value

bool

Filterable

Returns whether the field can be filtered

bool Filterable { get; }

Property Value

bool

Formula

Specifies the formula that is used for calculation in the field

string Formula { get; set; }

Property Value

string

FriendlyDisplayFormat

Gets or sets the friendly format type of a DateTime field

DateTimeFieldFriendlyFormatType FriendlyDisplayFormat { get; set; }

Property Value

DateTimeFieldFriendlyFormatType

FromBaseType

Gets a Boolean value that indicates whether the field derives from a base field type.

bool FromBaseType { get; }

Property Value

bool

Group

Gets or Sets the group of the field

string Group { get; set; }

Property Value

string

Hidden

Specifies whether the field is displayed in the list

bool Hidden { get; set; }

Property Value

bool

Id

Provides the id of the field

Guid Id { get; }

Property Value

Guid

IndexStatus

Describes whether a field is indexed, and whether the data in the index is complete

FieldIndexStatus IndexStatus { get; }

Property Value

FieldIndexStatus

Indexed

Gets or Sets whether the field is indexed

bool Indexed { get; set; }

Property Value

bool

InternalName

Specifies the internal name of the field

string InternalName { get; }

Property Value

string

IsAnchorValid

Gets a Boolean value that specifies whether the Term object identified by the AnchorId property is valid.

bool IsAnchorValid { get; }

Property Value

bool

IsDependentLookup

Check whether a lookup field is a dependent lookup field

bool IsDependentLookup { get; }

Property Value

bool

IsKeyword

Gets or sets a Boolean value that indicates whether the TaxonomyField value points to the Enterprise Keywords TermSet object.

bool IsKeyword { get; set; }

Property Value

bool

IsPathRendered

Gets or sets a Boolean value that specifies whether the default Label objects of all the parent Term objects of a Term in the TaxonomyField object will be rendered in addition to the default label of that Term.

bool IsPathRendered { get; set; }

Property Value

bool

IsRelationship

Specifies whether this Lookup field is discoverable from the List being looked up to

bool IsRelationship { get; set; }

Property Value

bool

IsTermSetValid

Gets a Boolean value that specifies whether the TermSet object identified by the TermSetId property exists and is available for tagging.

bool IsTermSetValid { get; }

Property Value

bool

Gets or sets the name of an external JS file containing any client rendering logic for fields of this type

string JSLink { get; set; }

Property Value

string

LookupField

Specifies the name of the Field used as the lookup values

string LookupField { get; set; }

Property Value

string

LookupList

Specifies the id (GUID) of the List that contains the Field to use as the lookup values

string LookupList { get; set; }

Property Value

string

LookupWebId

Specifies the id of the Site that contains the List which contains the Field used as the lookup values

Guid LookupWebId { get; set; }

Property Value

Guid

Mappings

Gets the mappings of a choice field

string Mappings { get; }

Property Value

string

MaxLength

Specifies the maximum number of characters that can be typed in the field

int MaxLength { get; set; }

Property Value

int

MaximumValue

Gets or sets the maximum value of a number field

double MaximumValue { get; set; }

Property Value

double

MinimumValue

Gets or sets the minimum value of a number field

double MinimumValue { get; set; }

Property Value

double

NumberOfLines

Gets or sets a value that specifies the number of lines of text to display for the field.

int NumberOfLines { get; set; }

Property Value

int

Open

Gets or sets a Boolean value that specifies whether the new Term objects can be added to the TermSet while typing in the TaxonomyField editor control.

bool Open { get; set; }

Property Value

bool

OutputType

Gets or sets the type of a calculated field output

FieldType OutputType { get; set; }

Property Value

FieldType

Presence

Gets or sets whether to display the presence indicator of the user

bool Presence { get; set; }

Property Value

bool

PrimaryFieldId

Specifies the GUID of the primary lookup field if this is a dependent lookup field. Otherwise, it is empty string

string PrimaryFieldId { get; set; }

Property Value

string

ReadOnlyField

Specifies whether values in the field can be modified

bool ReadOnlyField { get; set; }

Property Value

bool

RelationshipDeleteBehavior

Specifies the Delete Behavior of the Lookup Field

RelationshipDeleteBehaviorType RelationshipDeleteBehavior { get; set; }

Property Value

RelationshipDeleteBehaviorType

Required

Gets or Sets whether the field is required

bool Required { get; set; }

Property Value

bool

RestrictedMode

Gets or sets a value that specifies whether the field supports a subset of rich formatting.

bool RestrictedMode { get; set; }

Property Value

bool

RichText

Gets or sets a value that specifies whether the field supports rich formatting.

bool RichText { get; set; }

Property Value

bool

SchemaXml

Specifies the schema that defines the field

string SchemaXml { get; set; }

Property Value

string

Scope

Specifies the ServerRelativeUrl of the of the web site folder in which the field belongs to

string Scope { get; }

Property Value

string

Sealed

Specifies whether the field can be changed or deleted

bool Sealed { get; set; }

Property Value

bool

SelectionGroup

Gets or sets the Id of the group to which the users to select belong to

int SelectionGroup { get; set; }

Property Value

int

SelectionMode

Gets or sets the selection mode of the user field

FieldUserSelectionMode SelectionMode { get; set; }

Property Value

FieldUserSelectionMode

ShowAsPercentage

Gets or Sets whether the field should be shown as percentage Valid for Number field, Calculated field

bool ShowAsPercentage { get; set; }

Property Value

bool

ShowInFiltersPane

Represents status to determine whether filters pane will show the field

ShowInFiltersPaneStatus ShowInFiltersPane { get; set; }

Property Value

ShowInFiltersPaneStatus

Sortable

Returns whether the field can be sorted

bool Sortable { get; }

Property Value

bool

SspId

Gets or sets the GUID that identifies the TermStore object, which contains the Enterprise Keywords for the site that the current TaxonomyField belongs to.

Guid SspId { get; set; }

Property Value

Guid

StaticName

Specifies the static name of the field

string StaticName { get; }

Property Value

string

TargetTemplate

Gets or sets the Web-relative URL of the target page that is used to construct the hyperlink on each Term object when the TaxonomyField object is rendered.

string TargetTemplate { get; set; }

Property Value

string

TermSetId

Gets or sets the GUID of the TermSet object that contains the Term objects used by the current TaxonomyField object.

Guid TermSetId { get; set; }

Property Value

Guid

TextField

Gets or sets the GUID that identifies the hidden text field in an item.

Guid TextField { get; set; }

Property Value

Guid

Title

Gets or Sets the title of the field

string Title { get; set; }

Property Value

string

TypeAsString

Specifies the FieldTypeKind of the field as a string value

string TypeAsString { get; }

Property Value

string

TypeDisplayName

Specifies the display name for FieldTypeKind of the field

string TypeDisplayName { get; }

Property Value

string

TypeShortDescription

Specifies the description of the FieldTypeKind of the field

string TypeShortDescription { get; }

Property Value

string

UnlimitedLengthInDocumentLibrary

Gets or sets a value that specifies whether the field supports unlimited length in document libraries.

bool UnlimitedLengthInDocumentLibrary { get; set; }

Property Value

bool

UserCreated

Gets or sets a Boolean value that specifies whether the TaxonomyField object is linked to a customized TermSet object.

bool UserCreated { get; set; }

Property Value

bool

ValidationFormula

Specifies the formula referred by the field and gets evaluated when a list item is added or updated in the list

string ValidationFormula { get; set; }

Property Value

string

ValidationMessage

Specifies the message to display if validation formula fails for the field when a list item is added or updated in the list

string ValidationMessage { get; set; }

Property Value

string

Methods

NewFieldLocationValue(string, double, double)

Creates a new IFieldLocationValue object

IFieldLocationValue NewFieldLocationValue(string displayName, double latitude, double longitude)

Parameters

displayName string

Name to display for this location

latitude double

Latitude for the location

longitude double

Longitude for the location

Returns

IFieldLocationValue

Configured IFieldLocationValue object

NewFieldLookupValue(int)

Creates a new IFieldLookupValue object

IFieldLookupValue NewFieldLookupValue(int lookupId)

Parameters

lookupId int

Id of the lookup value

Returns

IFieldLookupValue

Configured IFieldLookupValue object

NewFieldTaxonomyValue(Guid, string, int)

Creates a new IFieldTaxonomyValue object

IFieldTaxonomyValue NewFieldTaxonomyValue(Guid termId, string label, int wssId = -1)

Parameters

termId Guid

Name of the term to set

label string

Label of the term to set

wssId int

Optionally provide the wssId value

Returns

IFieldTaxonomyValue

Configured IFieldTaxonomyValue object

NewFieldUrlValue(string, string)

Creates a new IFieldUrlValue object

IFieldUrlValue NewFieldUrlValue(string url, string description = null)

Parameters

url string

Url value

description string

Optional description value

Returns

IFieldUrlValue

Configured IFieldUrlValue object

NewFieldUserValue(ISharePointPrincipal)

Creates a new IFieldUserValue object

IFieldUserValue NewFieldUserValue(ISharePointPrincipal principal)

Parameters

principal ISharePointPrincipal

ISharePointUser or ISharePointGroup

Returns

IFieldUserValue

Configured IFieldUserValue object

NewFieldUserValue(int)

Creates a new IFieldUserValue object

IFieldUserValue NewFieldUserValue(int userId)

Parameters

userId int

Id of the user

Returns

IFieldUserValue

Configured IFieldUserValue object

NewFieldValueCollection()

Creates a new collection to hold IFieldValue objects

IFieldValueCollection NewFieldValueCollection()

Returns

IFieldValueCollection

NewFieldValueCollection(IEnumerable<IFieldValue>)

Creates a new collection to hold IFieldValue objects

IFieldValueCollection NewFieldValueCollection(IEnumerable<IFieldValue> fieldValues)

Parameters

fieldValues IEnumerable<IFieldValue>

Collection of field values to add

Returns

IFieldValueCollection

NewFieldValueCollection(IEnumerable<KeyValuePair<Guid, string>>)

Creates a new collection to hold IFieldTaxonomyValue objects

IFieldValueCollection NewFieldValueCollection(IEnumerable<KeyValuePair<Guid, string>> fieldValues)

Parameters

fieldValues IEnumerable<KeyValuePair<Guid, string>>

Collection of field values to add

Returns

IFieldValueCollection

SetShowInDisplayForm(bool)

Configure the visibility of the field in a Display form

void SetShowInDisplayForm(bool show)

Parameters

show bool

True when the field will be configured as visible (= default), false otherwise

SetShowInDisplayFormAsync(bool)

Configure the visibility of the field in a Display form

Task SetShowInDisplayFormAsync(bool show)

Parameters

show bool

True when the field will be configured as visible (= default), false otherwise

Returns

Task

SetShowInEditForm(bool)

Configure the visibility of the field in a Edit form

void SetShowInEditForm(bool show)

Parameters

show bool

True when the field will be configured as visible (= default), false otherwise

SetShowInEditFormAsync(bool)

Configure the visibility of the field in a Edit form

Task SetShowInEditFormAsync(bool show)

Parameters

show bool

True when the field will be configured as visible (= default), false otherwise

Returns

Task

SetShowInNewForm(bool)

Configure the visibility of the field in a New form

void SetShowInNewForm(bool show)

Parameters

show bool

True when the field will be configured as visible (= default), false otherwise

SetShowInNewFormAsync(bool)

Configure the visibility of the field in a New form

Task SetShowInNewFormAsync(bool show)

Parameters

show bool

True when the field will be configured as visible (= default), false otherwise

Returns

Task

UpdateAndPushChanges()

Updates the field and pushes changes down to lists consuming this field

void UpdateAndPushChanges()

UpdateAndPushChangesAsync()

Updates the field and pushes changes down to lists consuming this field

Task UpdateAndPushChangesAsync()

Returns

Task

UpdateAndPushChangesBatch()

Updates the field and pushes changes down to lists consuming this field

void UpdateAndPushChangesBatch()

UpdateAndPushChangesBatch(Batch)

Updates the field and pushes changes down to lists consuming this field

void UpdateAndPushChangesBatch(Batch batch)

Parameters

batch Batch

Batch to add this request to

UpdateAndPushChangesBatchAsync()

Updates the field and pushes changes down to lists consuming this field

Task UpdateAndPushChangesBatchAsync()

Returns

Task

UpdateAndPushChangesBatchAsync(Batch)

Updates the field and pushes changes down to lists consuming this field

Task UpdateAndPushChangesBatchAsync(Batch batch)

Parameters

batch Batch

Batch to add this request to

Returns

Task