I have a ParticipantsPickerId (Attendees) field in my Calendar List in Sharepoint 2013. How add value current user in this field.


Sample code for your reference:

<script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">

var listName = 'Testcal';

var userid = _spPageContextInfo.userId;  

var taskProperties = {
    '__metadata': { "type": "SP.Data.TestcalListItem" },
    "Title": 'New caledar item',
    'ParticipantsPickerIdId': userid  //single-valued User field value 

    url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items",
    type: "POST",
    contentType: "application/json;odata=verbose",
    data: JSON.stringify(taskProperties),
    headers: {
        "Accept": "application/json;odata=verbose",
        "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: function (data) {
    error: function (data) {

enter image description here

| improve this answer | |
  • Is it possible Update field, not overwriting old records? – alexaf Jul 10 '18 at 12:11

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.