0

I want to copy a list item from one list to the other using PnP PowerShell.

To copy a list item from one List:

Get-PnPListItem ???

And to paste the copied item to the other List:

Set-PnPListItem -List "MyList" -Identity "72" -Values @{"Omschrijving"="​​​Dit is een test"} -SystemUpdate

Column "Omschrijving" is a multiple-line column with rich text. And will be the in format (bold, underlined etc..) of the text be copied too.

1

Yes, you need to use Get-PnPListItem command to get the source list item & Set-PnPListItem to update the list item (or Add-PnPListItem to create new list item).

Check below links for more details & code snippets:

  1. Powershell Script to copy List items from one Column to another in a Sharepoint online Library
  2. How To Copy SharePoint List Data From One List To Other Using PnP PowerShell - Adds new item in target list
2
  • I need in the Get-PnpListItem to get the text in the column "Omschrijving" of the first row. How can i do that? P – user2170776 Apr 6 at 8:36
  • You need to pass the item ID to Get-PnPListItem command, like: Get-PnPListItem -List listName -Id 1. Where 1 is the item ID. You can pass the ID of item for which you want to get the column "Omschrijving". Check documentation for more details. – Ganesh Sanap Apr 6 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.