SharePoint Online SPOMod: Set-SPOListItem
This article describes a function of a custom SharePoint Online module available for download and installation on GitHub where it welcomes all your suggestions and contributions.
Set-SPOListItem
Updates a list item.
Parameters
ListTitle | Mandatory | Name of the list |
ItemID | Mandatory | ID of the item |
FieldToUpdate | Mandatory | The name of the field to insert/update information into. The field corresponds to a list column. Make sure to use InternalName of the column, and not DisplayName often showed in the views. |
ValueToUpdate | Mandatory | Information to be inserted into the column for that item |
Examples
----- EXAMPLE 1 ------
Update a yes/no column.
Set-SPOListItem -ListTitle MyList6 -ItemID 14 -FieldToUpdate "fgd" -ValueToUpdate $false
----- EXAMPLE 2 ------
Update a text column.
Set-SPOListItem -ListTitle MyList6 -ItemID 15 -FieldToUpdate "CSTColumn" -ValueToUpdate "I am writing something"
----- EXAMPLE 3 ------
Add information to an existing field for all items.
$itemy=(Get-SPOListItems MyList6)
foreach($item in $itemy){ Set-SPOListItem -ListTitle MyList6 -ItemID $item.ID -FieldToUpdate "Title" -ValueToUpdate ($item.Title+" Updated")}
See Also
SPOMod Cmdlets and Resources
Connect-SPOCSOM
Get-SPOList
New-SPOListItem
Get-SPOListItems
Remove-SPOListItem