Copy value from one filed to another field using PowerShell

Advertisement


In this example we are showing how to copy values from one item to another item.

We are having a column with multi-level field type we are unable to do Group by for this field, so we planned to change the field type to text and copy the values from Multi type field to Single line of Text, best option to achieve this functionality is PowerShell
How to update the modified by using power shell
How to add fields to list in sharepoint using powershell
How to create topic for discussion board in sharepoint using powershell
 
 Add-PSSnapin Microsoft.Sharepoint.Powershell

    $web =  Get-SPWeb -Identity http://dotnetsharepoint.com/sites/sharepoint/copyitems

    $list =$web.Lists["ListName"]

    $items = $list.items

    foreach ($item in $items)

    {

    $sourcevalue = $item["SourceColumn"]

    $item["DestinationColumn"] = $sourcevalue

    write-host $sourcevalue

    $item.update()

    }

    $list.update()
Please let me know having any issues.
 SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM
Advertisements
SHARE

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a comment