Mục lục bài viết

Mẹo về Set-PnPListItem date Chi Tiết

Update: 2022-02-09 14:57:03,You Cần tương hỗ về Set-PnPListItem date. Bạn trọn vẹn có thể lại phản hồi ở cuối bài để Ad đc tương hỗ.

618

The PowerShell commands of the PnP Frameworkhave many useful commands that help you manage SharePoint trực tuyến. One of these commands is the Set-SPOListItem Command.

Tóm lược đại ý quan trọng trong bài

  • Single line of text columns
  • Multiple lines of text columns
  • Choice column
  • Number column
  • Currency column
  • Date and Time column
  • Lookup column
  • Yes/No column
  • Person/Group column
  • Multi-Person column
  • Hyperlink or Picture column
  • Share this:
  • Post navigation

Set-SPOListItem Identity <ListItemPipeBind> [ContentType <ContentTypePipeBind>] [Values <Hashtable>] [Web <WebPipeBind>] List <ListPipeBind>

All the parameters are quite easy to understand:

ParameterTypeRequiredDescriptionContentTypeContentTypePipeBindFalseSpecify either the name, ID or an actual content typeIdentityListItemPipeBindTrueThe ID of the listitem, or actual ListItem objectListListPipeBindTrueThe ID, Title or Url of the list.ValuesHashtableFalseUse the internal names of the fields when specifying field namesWebWebPipeBindFalseThe web to apply the command to. Omit this parameter to use the current web.

The majority of the issues with this command are related to the Values. How do you update all the different column formats. In this article Im trying to give a full overview of all the possible options.

I have created a list called TestList and Ive added a list item to the list. For each column type of Ive added a new column to the list.

Single line of text columns

Table of Contents

  • Single line of text columns
  • Multiple lines of text columns
  • Choice column
  • Number column
  • Currency column
  • Date and Time column
  • Lookup column
  • Yes/No column
  • Person/Group column
  • Multi-Person column
  • Hyperlink or Picture column

Set-SPOListItem -List TestList -Identity 1 -Values @Title = Title New

Multiple lines of text columns

For a simple multiple lines of text column the following will work:

Set-SPOListItem -List TestList -Identity 1 -Values @MultiText = New text

To update formatting in the rich text field use the following syntax by including html.

Set-SPOListItem -List TestList -Identity 1 -Values @MultiText = New text

Choice column

For a choice column called Choicethat has the options

  • Value 1
  • Value 2
  • Value 3

The following syntax can be used:

Set-SPOListItem -List TestList -Identity 1 -Values @Choice = Value 1

Number column

Set-SPOListItem -List TestList -Identity 1 -Values @Number = 10

Currency column

Set-SPOListItem -List TestList -Identity 1 -Values @Currency = 10

Date and Time column

Set-SPOListItem -List TestList -Identity 1 -Values @DateAndTime = 03/10/năm ngoái 14:16

Lookup column

Ok, setting lookups can be really complicated. Well not with the PnP PowerShell commands. Simply use the ID of the item in the Lookup:

Set-SPOListItem -List TestList -Identity 1 -Values @Lookup = 2

Yes/No column

Set-SPOListItem -List TestList -Identity 1 -Values @YesNo = No

Person/Group column

Setting a person field is harder

Set-SPOListItem -List TestList -Identity 1 -Values @Person = 3

The above sets the person field to the owner groupof the site. I found that 1 sets the user toan internal user. 2 gives an invalid user.

Multi-Person column

For a multi-people column the following lines of PowerShell will add 2 people:

$peopleArr = @()

$peopleArr +=
$peopleArr +=
Set-SPOListItem -List testlist -Identity 1 -Values @People=$peopleArr

Set-SPOListItem -List TestList -Identity 1 -Values @Hyperlink = sharepains, SharePains

Share this:

  • Tweet
  • WhatsApp
  • E-Mail

Like this:

Like Loading…

Related

Post navigation

Office 365 SharePoint Team Site or Team Site SharePoint Online ConfigurationOffice 365 SharePoint The New Site Contents A Complete Overview

Reply
9
0
Chia sẻ

Video full hướng dẫn Chia Sẻ Link Down Set-PnPListItem date ?

– Một số từ khóa tìm kiếm nhiều : ” Video full hướng dẫn Set-PnPListItem date tiên tiến và phát triển nhất , Share Link Cập nhật Set-PnPListItem date “.

Hỏi đáp vướng mắc về Set-PnPListItem date

You trọn vẹn có thể để lại Comments nếu gặp yếu tố chưa hiểu nha.
#SetPnPListItem #date Set-PnPListItem date