0

I created a custom list and here I want to copy Created By column value to another field in same list

  • Source Field: Created By
  • Destination Field: Item Created User (this is Person/Group Field)

I have SP 2013 & Presently no workflows configured. I want to do by Simple PowerShell script.

    1 Answer 1

    0

    I made this PowerShell script for you

    Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue $listName = "CustomList1" #Get the SPWeb object $web = Get-SPWeb http://spwapp/ #Get the SPList $list = $web.Lists[$listName] #Get all items in this list $items = $list.items #Go through all items foreach($item in $items) { $created = $item["Created By"] $item["DestinationPG"] = $created #Update the item $item.Update() } 

    Copy and Paste this script, refer to your SP2013 site url and your List name, and execute it, it will update all the items at once.

    FROM THISenter image description here

    TO THISenter image description here

    If this answers suit you, please upvote and accept it as an answer

    6
    • Hi Aimen, when run this script no changes will happen destinatinfield has empty value, note here that Created By is person group field.CommentedJun 29, 2021 at 10:42
    • Ah, I thought you wanted "Created" column, well, its gonna be the same, i will edit my answerCommentedJun 29, 2021 at 11:01
    • @user3520155, here is it, answer edited !CommentedJun 29, 2021 at 11:09
    • yes i give Destination Field also Person Group type field but no value copiedCommentedJun 29, 2021 at 11:19
    • are you sure you are not missing something? it's working perfectly from my side !CommentedJun 29, 2021 at 11:38

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.