Setting default value for person column to current user in SharePoint 2013 using REST





Add a content editor WebPart to the New form of custom list and add the below code, replace line 18 SetUserFieldValue function parameter to your people picker column name.



Comments

  1. I'm trying to hide the picker field after filling it so the user can't edit it. Any ideas how to extend your code with such function?

    ReplyDelete
  2. great! It really works for me. Thank you

    ReplyDelete
  3. Where's the code??????

    ReplyDelete
    Replies
    1. If you are not able view the code in the post, then use this url.

      Delete
  4. Hi, what can I change if I want to use another user, for example domain\jcartin ?

    ReplyDelete
  5. What could be the code to add two values on the same field? thank you

    ReplyDelete
  6. Hello Rajesh, I get correct username(in Alert) after using above script however the peoplepicker does not identify the username. Any hint?

    ReplyDelete
  7. Thank you, it works perfectly for me

    ReplyDelete
  8. We have updated the sharepoint commulative updates to June, 2016 and now this script is not working, regards,

    ReplyDelete

Post a Comment