Closed
Description
Currently you can only get list items by id:
https://pnp.github.io/cli-microsoft365/cmd/spo/listitem/listitem-get/
However, it's also possible to retrieve them by UniqueId, which is handy in some situations.
It can be done by calling the following endpoint:
https://contoso.sharepoint.com/sites/Project-x/_api/Web/Lists('GUID')/GetItemByUniqueId('GUID')
Options
Option | Description |
---|---|
-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. |
Examples
Get an item by its Unique ID
m365 spo listitem get --listTitle "Demo List" --uniqueId "64dc28c4-3c43-45f6-ba66-307d9eb7e6aa" --webUrl https://contoso.sharepoint.com/sites/project-x