Skip to content

spo listitem set

Updates a list item in the specified list

Usage

spo listitem set [options]

Options

Option Description
--help output usage information
-u, --webUrl <webUrl> URL of the site where the item should be updated
-i, --id <id> ID of the list item to update.
-l, --listId [listId] ID of the list where the item should be updated. Specify listId or listTitle but not both
-t, --listTitle [listTitle] Title of the list where the item should be updated. Specify listId or listTitle but not both
-c, --contentType [contentType] The name or the ID of the content type to associate with the updated item
-s, --systemUpdate Update the item without updating the modified date and modified by fields
-o, --output [output] Output type. json|text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging

Important

Before using this command, log in to a SharePoint Online site, using the spo login command.

Remarks

To update an item in a list, you have to first log in to a SharePoint Online site using the spo login command, eg. spo login https://contoso.sharepoint.com.

Examples

Update an item with id 147 with title Demo Item and content type name Item in list with title Demo List in site https://contoso.sharepoint.com/sites/project-x

spo listitem set --contentType Item --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --Title "Demo Item"

Update an item with id 147 with title Demo Multi Managed Metadata Field and a single-select metadata field named SingleMetadataField in list with title Demo List in site https://contoso.sharepoint.com/sites/project-x

spo listitem set --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --Title "Demo Single Managed Metadata Field" --SingleMetadataField "TermLabel1|fa2f6bfd-1fad-4d18-9c89-289fe6941377;"

Update an item with id 147 with Title Demo Multi Managed Metadata Field and a multi-select metadata field named MultiMetadataField in list with title Demo List in site https://contoso.sharepoint.com/sites/project-x

spo listitem set --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --Title "Demo Multi Managed Metadata Field" --MultiMetadataField "TermLabel1|cf8c72a1-0207-40ee-aebd-fca67d20bc8a;TermLabel2|e5cc320f-8b65-4882-afd5-f24d88d52b75;"

Update an item with id 147 with Title Demo Single Person Field and a single-select people field named SinglePeopleField to list with title Demo List in site https://contoso.sharepoint.com/sites/project-x

spo listitem set --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --Title "Demo Single Person Field" --SinglePeopleField "[{'Key':'i:0#.f|membership|markh@conotoso.com'}]"

Update an item with id 147 with Title Demo Multi Person Field and a multi-select people field named MultiPeopleField to list with title Demo List in site https://contoso.sharepoint.com/sites/project-x

spo listitem set --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --Title "Demo Multi Person Field" --MultiPeopleField "[{'Key':'i:0#.f|membership|markh@conotoso.com'},{'Key':'i:0#.f|membership|adamb@conotoso.com'}]"

Update an item with id 147 with Title Demo Hyperlink Field and a hyperlink field named CustomHyperlink to list with title Demo List in site https://contoso.sharepoint.com/sites/project-x

spo listitem set --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --Title "Demo Hyperlink Field" --CustomHyperlink "https://www.bing.com, Bing"