Skip to main content

spo listitem get

Gets a list item from the specified list

Usage

m365 spo listitem get [options]

Options

-u, --webUrl <webUrl>

URL of the site where the item is located.

-i, --id [id]

ID of the item to retrieve. Specify either id or uniqueId but not both.

--uniqueId [uniqueId]

The Unique ID (GUID) of the item to retrieve. Specify either id or uniqueId but not both.

-l, --listId [listId]

ID of the list. Specify either listTitle, listId, or listUrl but not multiple.

-t, --listTitle [listTitle]

Title of the list. Specify either listTitle, listId, or listUrl but not multiple.

--listUrl [listUrl]

Server- or site-relative URL of the list. Specify either listTitle, listId, or listUrl but not multiple.

-p, --properties [properties]

Comma-separated list of properties to retrieve. Will retrieve all properties if not specified and json output is requested.

--withPermissions

Set if you want to return associated roles and permissions.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

If you want to specify a lookup type in the properties option, define which columns from the related list should be returned.

Examples

Get an item with the ID parameter from a given list in a given site.

m365 spo listitem get --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x

Get an item with the Unique ID parameter from a given list in a given site.

m365 spo listitem get --listTitle "Demo List" --uniqueId "64dc28c4-3c43-45f6-ba66-307d9eb7e6aa" --webUrl https://contoso.sharepoint.com/sites/project-x

Get an item columns with the ID parameter from a given list in a given site.

m365 spo listitem get --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --properties "Title,Created"

Get an item columns and lookup column with the ID parameter from a given list in a given site.

m365 spo listitem get --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --properties "Title,Created,Company/Title"

Get an item with specific properties from a given list based on the server-relative URL in a specific site.

m365 spo listitem get --listUrl /sites/project-x/documents --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --properties "Title,Created,Company/Title"

Get an item with ID parameter from a given list based on the server-relative URL in a specific site with permissions.

m365 spo listitem get --listTitle "Demo List" --id 147 --webUrl https://contoso.sharepoint.com/sites/project-x --withPermissions

Response

{
"FileSystemObjectType": 0,
"Id": 147,
"ServerRedirectedEmbedUri": null,
"ServerRedirectedEmbedUrl": "",
"ContentTypeId": "0x010078BC2C6F12F0DB41BA554210A2BFA81600A320A11ABE6E90468525ECC747660126",
"Title": "Demo Item",
"Modified": "2022-10-30T10:55:37Z",
"Created": "2022-10-30T10:55:22Z",
"AuthorId": 10,
"EditorId": 10,
"OData__UIVersionString": "3.0",
"Attachments": false,
"GUID": "87f3138d-fac3-4126-97c0-543e55672261",
"ComplianceAssetId": null
}

withPermissions response

When we make use of the option withPermissions the response will differ.

Response

{
"FileSystemObjectType": 0,
"Id": 147,
"ServerRedirectedEmbedUri": null,
"ServerRedirectedEmbedUrl": "",
"ContentTypeId": "0x010078BC2C6F12F0DB41BA554210A2BFA81600A320A11ABE6E90468525ECC747660126",
"Title": "Demo Item",
"Modified": "2022-10-30T10:55:37Z",
"Created": "2022-10-30T10:55:22Z",
"AuthorId": 10,
"EditorId": 10,
"OData__UIVersionString": "3.0",
"Attachments": false,
"GUID": "87f3138d-fac3-4126-97c0-543e55672261",
"ComplianceAssetId": null,
"RoleAssignments": [
{
"Member": {
"Id": 3,
"IsHiddenInUI": false,
"LoginName": "Communication site Owners",
"Title": "Communication site Owners",
"PrincipalType": 8,
"AllowMembersEditMembership": false,
"AllowRequestToJoinLeave": false,
"AutoAcceptRequestToJoinLeave": false,
"Description": null,
"OnlyAllowMembersViewMembership": false,
"OwnerTitle": "Communication site Owners",
"RequestToJoinLeaveEmailSetting": ""
},
"RoleDefinitionBindings": [
{
"BasePermissions": {
"High": "2147483647",
"Low": "4294967295"
},
"Description": "Has full control.",
"Hidden": false,
"Id": 1073741829,
"Name": "Full Control",
"Order": 1,
"RoleTypeKind": 5,
"BasePermissionsValue": [
"ViewListItems",
"AddListItems",
"EditListItems",
"DeleteListItems",
"ApproveItems",
"OpenItems",
"ViewVersions",
"DeleteVersions",
"CancelCheckout",
"ManagePersonalViews",
"ManageLists",
"ViewFormPages",
"AnonymousSearchAccessList",
"Open",
"ViewPages",
"AddAndCustomizePages",
"ApplyThemeAndBorder",
"ApplyStyleSheets",
"ViewUsageData",
"CreateSSCSite",
"ManageSubwebs",
"CreateGroups",
"ManagePermissions",
"BrowseDirectories",
"BrowseUserInfo",
"AddDelPrivateWebParts",
"UpdatePersonalWebParts",
"ManageWeb",
"AnonymousSearchAccessWebLists",
"UseClientIntegration",
"UseRemoteAPIs",
"ManageAlerts",
"CreateAlerts",
"EditMyUserInfo",
"EnumeratePermissions"
],
"RoleTypeKindValue": "Administrator"
}
],
"PrincipalId": 3
}
]
}
CTRL + M