Table of Contents

Interface IListItem

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

Public interface to define a SharePoint Online list item

public interface IListItem : IDataModel<IListItem>, IDataModelParent, IDataModelWithContext, ISupportModules<IListItem>, IDataModelGet<IListItem>, IDataModelLoad<IListItem>, IDataModelUpdate, IDataModelDelete, IDataModelSupportingGetChanges, ISecurableObject, IExpandoDataModel, 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

AttachmentFiles

Collection of attachments for this list item Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IAttachmentCollection AttachmentFiles { get; }

Property Value

IAttachmentCollection

CommentsDisabled

Determines if comments are disabled for the list item

bool CommentsDisabled { get; }

Property Value

bool

CommentsDisabledScope

The scope for which comments are disabled

CommentsDisabledScope CommentsDisabledScope { get; }

Property Value

CommentsDisabledScope

ContentType

The content type for the list item

IContentType ContentType { get; }

Property Value

IContentType

FieldValuesAsHtml

All the field values for the list item as HTML

IFieldStringValues FieldValuesAsHtml { get; }

Property Value

IFieldStringValues

FieldValuesAsText

All the field values for the list item as text

IFieldStringValues FieldValuesAsText { get; }

Property Value

IFieldStringValues

FieldValuesForEdit

All the field values for the list item for editing

IFieldStringValues FieldValuesForEdit { get; }

Property Value

IFieldStringValues

File

The file, if any, associated with the list item

IFile File { get; }

Property Value

IFile

FileSystemObjectType

The FileSystemObjectType for the list item, such as Folder or File

FileSystemObjectType FileSystemObjectType { get; }

Property Value

FileSystemObjectType

Folder

The folder, if any, represented by the list item

IFolder Folder { get; }

Property Value

IFolder

Id

Id of the list item

int Id { get; }

Property Value

int

LikedByInformation

Information about the likes on this list item

ILikedByInformation LikedByInformation { get; }

Property Value

ILikedByInformation

ParentList

The list for the list item

IList ParentList { get; }

Property Value

IList

Properties

The properties of the list item

IPropertyValues Properties { get; }

Property Value

IPropertyValues

ServerRedirectedEmbedUri

The URI used to render the WOPI (Web Application Open Platform Interface) frame

string ServerRedirectedEmbedUri { get; }

Property Value

string

ServerRedirectedEmbedUrl

The URL used to render the WOPI (Web Application Open Platform Interface) frame

string ServerRedirectedEmbedUrl { get; }

Property Value

string

Title

Title value of the list item

string Title { get; set; }

Property Value

string

UniqueId

The unique identifier of the list item

Guid UniqueId { get; }

Property Value

Guid

Versions

Gets a value that returns a collection of list item version objects that represent the versions of the list item Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IListItemVersionCollection Versions { get; }

Property Value

IListItemVersionCollection

Methods

AreCommentsDisabled()

Are comments disabled for this IListItem?

bool AreCommentsDisabled()

Returns

bool

True if disabled, false otherwise

AreCommentsDisabledAsync()

Are comments disabled for this IListItem?

Task<bool> AreCommentsDisabledAsync()

Returns

Task<bool>

True if disabled, false otherwise

CheckIfUserHasPermissions(string, PermissionKind)

Checks if a user has a specific kind of permissions to a listitem

bool CheckIfUserHasPermissions(string userPrincipalName, PermissionKind permissionKind)

Parameters

userPrincipalName string

Login name of the user you wish to check if he has a specific permission

permissionKind PermissionKind

Permission kind to check

Returns

bool

Boolean that says if the user has permissions or not

CheckIfUserHasPermissionsAsync(string, PermissionKind)

Checks if a user has a specific kind of permissions to a listitem

Task<bool> CheckIfUserHasPermissionsAsync(string userPrincipalName, PermissionKind permissionKind)

Parameters

userPrincipalName string

Login name of the user you wish to check if he has a specific permission

permissionKind PermissionKind

Permission kind to check

Returns

Task<bool>

Boolean that says if the user has permissions or not

Creates an anonymous sharing link for a list item

IGraphPermission CreateAnonymousSharingLink(AnonymousLinkOptions anonymousLinkOptions)

Parameters

anonymousLinkOptions AnonymousLinkOptions

Returns

IGraphPermission

Permission that has been created

CreateAnonymousSharingLinkAsync(AnonymousLinkOptions)

Creates an anonymous sharing link for a list item

Task<IGraphPermission> CreateAnonymousSharingLinkAsync(AnonymousLinkOptions anonymousLinkOptions)

Parameters

anonymousLinkOptions AnonymousLinkOptions

Returns

Task<IGraphPermission>

Permission that has been created

Creates an organization sharing link for a list item

IGraphPermission CreateOrganizationalSharingLink(OrganizationalLinkOptions organizationalLinkOptions)

Parameters

organizationalLinkOptions OrganizationalLinkOptions

Returns

IGraphPermission

Permission that has been created

CreateOrganizationalSharingLinkAsync(OrganizationalLinkOptions)

Creates an organization sharing link for a list item

Task<IGraphPermission> CreateOrganizationalSharingLinkAsync(OrganizationalLinkOptions organizationalLinkOptions)

Parameters

organizationalLinkOptions OrganizationalLinkOptions

Returns

Task<IGraphPermission>

Permission that has been created

Creates a user sharing link for a list item

IGraphPermission CreateUserSharingLink(UserLinkOptions userLinkOptions)

Parameters

userLinkOptions UserLinkOptions

Returns

IGraphPermission

Permission that has been created

CreateUserSharingLinkAsync(UserLinkOptions)

Creates a user sharing link for a list item

Task<IGraphPermission> CreateUserSharingLinkAsync(UserLinkOptions userLinkOptions)

Parameters

userLinkOptions UserLinkOptions

Returns

Task<IGraphPermission>

Permission that has been created

GetComments(params Expression<Func<IComment, object>>[])

Get list item comments

ICommentCollection GetComments(params Expression<Func<IComment, object>>[] selectors)

Parameters

selectors Expression<Func<IComment, object>>[]

The expressions declaring the fields to select

Returns

ICommentCollection

GetCommentsAsync(params Expression<Func<IComment, object>>[])

Get list item comments

Task<ICommentCollection> GetCommentsAsync(params Expression<Func<IComment, object>>[] selectors)

Parameters

selectors Expression<Func<IComment, object>>[]

The expressions declaring the fields to select

Returns

Task<ICommentCollection>

GetDisplayName()

Gets the display name of the list item.

string GetDisplayName()

Returns

string

The display name or null.

GetDisplayNameAsync()

Gets the display name of the list item.

Task<string> GetDisplayNameAsync()

Returns

Task<string>

The display name or null.

GetParentFolder()

Returns the IFolder that holds this item

IFolder GetParentFolder()

Returns

IFolder

The IFolder for this item is returned, if the item itself is a folder then the item is returned as IFolder.

GetParentFolderAsync()

Returns the IFolder that holds this item

Task<IFolder> GetParentFolderAsync()

Returns

Task<IFolder>

The IFolder for this item is returned, if the item itself is a folder then the item is returned as IFolder.

GetUserEffectivePermissions(string)

Gets the user effective permissions of a user for a listitem

IBasePermissions GetUserEffectivePermissions(string userPrincipalName)

Parameters

userPrincipalName string

Login name of the user you wish to retrieve the permissions of

Returns

IBasePermissions

Base permissions object that contains the High and the Low permissions

GetUserEffectivePermissionsAsync(string)

Gets the user effective permissions of a user for a listitem

Task<IBasePermissions> GetUserEffectivePermissionsAsync(string userPrincipalName)

Parameters

userPrincipalName string

Login name of the user you wish to retrieve the permissions of

Returns

Task<IBasePermissions>

Base permissions object that contains the High and the Low permissions

IsFile()

Checks if this IListItem is a file

bool IsFile()

Returns

bool

Returns true if this IListItem is a file.

IsFileAsync()

Checks if this IListItem is a file

Task<bool> IsFileAsync()

Returns

Task<bool>

Returns true if this IListItem is a file.

IsFolder()

Checks if this IListItem is a folder

bool IsFolder()

Returns

bool

Returns true if this IListItem is a folder.

IsFolderAsync()

Checks if this IListItem is a folder

Task<bool> IsFolderAsync()

Returns

Task<bool>

Returns true if this IListItem is a folder.

MoveTo(string)

Moves this ListItem to another folder in this list

void MoveTo(string destinationFolderUrl)

Parameters

destinationFolderUrl string

Folder path within this list, e.g. 'subfolder1/subfolder2'

MoveToAsync(string)

Moves this ListItem to another folder in this list

Task MoveToAsync(string destinationFolderUrl)

Parameters

destinationFolderUrl string

Folder path within this list, e.g. 'subfolder1/subfolder2'

Returns

Task

NewFieldLookupValue(IField, int)

Creates a new IFieldLookupValue object

IFieldLookupValue NewFieldLookupValue(IField fieldToUpdate, int lookupId)

Parameters

fieldToUpdate IField

IField representing the field to set

lookupId int

Id of the lookup value

Returns

IFieldLookupValue

Configured IFieldLookupValue object

NewFieldTaxonomyValue(IField, Guid, string, int)

Creates a new IFieldTaxonomyValue object

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

Parameters

fieldToUpdate IField

IField representing the field to set

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(IField, string, string)

Creates a new IFieldUrlValue object

IFieldUrlValue NewFieldUrlValue(IField fieldToUpdate, string url, string description = null)

Parameters

fieldToUpdate IField

IField representing the field to set

url string

Url value

description string

Optional description value

Returns

IFieldUrlValue

Configured IFieldUrlValue object

NewFieldUserValue(IField, ISharePointPrincipal)

Creates a new IFieldUserValue object

IFieldUserValue NewFieldUserValue(IField fieldToUpdate, ISharePointPrincipal principal)

Parameters

fieldToUpdate IField

IField representing the field to set

principal ISharePointPrincipal

ISharePointUser or ISharePointGroup

Returns

IFieldUserValue

Configured IFieldUserValue object

NewFieldUserValue(IField, int)

Creates a new IFieldUserValue object

IFieldUserValue NewFieldUserValue(IField fieldToUpdate, int userId)

Parameters

fieldToUpdate IField

IField representing the field to set

userId int

Id of the user

Returns

IFieldUserValue

Configured IFieldUserValue object

NewFieldValueCollection(IField)

Creates a new collection to hold IFieldValue objects

IFieldValueCollection NewFieldValueCollection(IField fieldToUpdate)

Parameters

fieldToUpdate IField

IField representing the field to set

Returns

IFieldValueCollection

Recycle()

Recycle the current item

Guid Recycle()

Returns

Guid

RecycleAsync()

Recycle the current item

Task<Guid> RecycleAsync()

Returns

Task<Guid>

RecycleBatch()

Recycle the current item

IBatchSingleResult<BatchResultValue<Guid>> RecycleBatch()

Returns

IBatchSingleResult<BatchResultValue<Guid>>

RecycleBatch(Batch)

Recycle the current item

IBatchSingleResult<BatchResultValue<Guid>> RecycleBatch(Batch batch)

Parameters

batch Batch

Batch to add the request to

Returns

IBatchSingleResult<BatchResultValue<Guid>>

RecycleBatchAsync()

Recycle the current item

Task<IBatchSingleResult<BatchResultValue<Guid>>> RecycleBatchAsync()

Returns

Task<IBatchSingleResult<BatchResultValue<Guid>>>

RecycleBatchAsync(Batch)

Recycle the current item

Task<IBatchSingleResult<BatchResultValue<Guid>>> RecycleBatchAsync(Batch batch)

Parameters

batch Batch

Batch to add the request to

Returns

Task<IBatchSingleResult<BatchResultValue<Guid>>>

SetCommentsDisabled(bool)

Enable/Disable comments for this list item

void SetCommentsDisabled(bool commentsDisabled)

Parameters

commentsDisabled bool

Do comments need to enabled or disabled

SetCommentsDisabledAsync(bool)

Enable/Disable comments for this list item

Task SetCommentsDisabledAsync(bool commentsDisabled)

Parameters

commentsDisabled bool

Do comments need to enabled or disabled

Returns

Task

SetComplianceTag(string, bool, bool, bool, bool)

Sets a compliancetag / retention label for this list item

void SetComplianceTag(string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)

Parameters

complianceTag string

The tag/label to set for this list item

isTagPolicyHold bool

Whether the tag is hold

isTagPolicyRecord bool

Whether the tag is record

isEventBasedTag bool

Whether the tag is Event based, this is not used

isTagSuperLock bool

Whether the tag is Sec 17 tag,no allow change even for site admin

SetComplianceTagAsync(string, bool, bool, bool, bool)

Sets a compliancetag / retention label for this list item

Task SetComplianceTagAsync(string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)

Parameters

complianceTag string

The tag/label to set for this list item

isTagPolicyHold bool

Whether the tag is hold

isTagPolicyRecord bool

Whether the tag is record

isEventBasedTag bool

Whether the tag is Event based, this is not used

isTagSuperLock bool

Whether the tag is Sec 17 tag,no allow change even for site admin

Returns

Task

SetComplianceTagBatch(Batch, string, bool, bool, bool, bool)

Sets a compliancetag / retention label for this list item

void SetComplianceTagBatch(Batch batch, string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)

Parameters

batch Batch

Batch to add the request to

complianceTag string

The tag/label to set for this list item

isTagPolicyHold bool

Whether the tag is hold

isTagPolicyRecord bool

Whether the tag is record

isEventBasedTag bool

Whether the tag is Event based, this is not used

isTagSuperLock bool

Whether the tag is Sec 17 tag,no allow change even for site admin

SetComplianceTagBatch(string, bool, bool, bool, bool)

Sets a compliancetag / retention label for this list item

void SetComplianceTagBatch(string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)

Parameters

complianceTag string

The tag/label to set for this list item

isTagPolicyHold bool

Whether the tag is hold

isTagPolicyRecord bool

Whether the tag is record

isEventBasedTag bool

Whether the tag is Event based, this is not used

isTagSuperLock bool

Whether the tag is Sec 17 tag,no allow change even for site admin

SetComplianceTagBatchAsync(Batch, string, bool, bool, bool, bool)

Sets a compliancetag / retention label for this list item

Task SetComplianceTagBatchAsync(Batch batch, string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)

Parameters

batch Batch

Batch to add the request to

complianceTag string

The tag/label to set for this list item

isTagPolicyHold bool

Whether the tag is hold

isTagPolicyRecord bool

Whether the tag is record

isEventBasedTag bool

Whether the tag is Event based, this is not used

isTagSuperLock bool

Whether the tag is Sec 17 tag,no allow change even for site admin

Returns

Task

SetComplianceTagBatchAsync(string, bool, bool, bool, bool)

Sets a compliancetag / retention label for this list item

Task SetComplianceTagBatchAsync(string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)

Parameters

complianceTag string

The tag/label to set for this list item

isTagPolicyHold bool

Whether the tag is hold

isTagPolicyRecord bool

Whether the tag is record

isEventBasedTag bool

Whether the tag is Event based, this is not used

isTagSuperLock bool

Whether the tag is Sec 17 tag,no allow change even for site admin

Returns

Task

SystemUpdate()

Performs a system update of the list item

void SystemUpdate()

SystemUpdateAsync()

Performs a system update of the list item

Task SystemUpdateAsync()

Returns

Task

SystemUpdateBatch()

Performs a system update of the list item

void SystemUpdateBatch()

SystemUpdateBatch(Batch)

Performs a system update of the list item

void SystemUpdateBatch(Batch batch)

Parameters

batch Batch

Batch to add the systemupdate request to

SystemUpdateBatchAsync()

Performs a system update of the list item

Task SystemUpdateBatchAsync()

Returns

Task

SystemUpdateBatchAsync(Batch)

Performs a system update of the list item

Task SystemUpdateBatchAsync(Batch batch)

Parameters

batch Batch

Batch to add the systemupdate request to

Returns

Task

UpdateOverwriteVersion()

Performs a UpdateOverwriteVersion of the list item

void UpdateOverwriteVersion()

UpdateOverwriteVersionAsync()

Performs a UpdateOverwriteVersion of the list item

Task UpdateOverwriteVersionAsync()

Returns

Task

UpdateOverwriteVersionBatch()

Performs a UpdateOverwriteVersion of the list item

void UpdateOverwriteVersionBatch()

UpdateOverwriteVersionBatch(Batch)

Performs a UpdateOverwriteVersion of the list item

void UpdateOverwriteVersionBatch(Batch batch)

Parameters

batch Batch

Batch to add the UpdateOverwriteVersion request to

UpdateOverwriteVersionBatchAsync()

Performs a UpdateOverwriteVersion of the list item

Task UpdateOverwriteVersionBatchAsync()

Returns

Task

UpdateOverwriteVersionBatchAsync(Batch)

Performs a UpdateOverwriteVersion of the list item

Task UpdateOverwriteVersionBatchAsync(Batch batch)

Parameters

batch Batch

Batch to add the UpdateOverwriteVersion request to

Returns

Task