1

I have people look up field in my list ..lets say "Checker" , its single selection user field but when i try to add user data to "Checker" field through rest api its not getting posted ...

$scope.formData.Checker.Title=$("#checker").val();

This is how i am storing data but when I hit save and check the list its storing the data to "Title" field but not "Checker" field. btw "Title" is the another field in my list

2

Single user field value

The example demonstrates how to create a task item and specify a single-valued AssignedTo field

//Create a Task item
var taskProperties = {
    '__metadata' : { 'type': 'SP.Data.TasksListItem' },
    'Title': 'Order approval',
    'AssignedToId' : 10
};
createListItem(_spPageContextInfo.webAbsoluteUrl,'Tasks',taskProperties)
.done(function(data)
{
   console.log('Task has been created successfully');
})
.fail(
function(error){
    console.log(JSON.stringify(error));
});

You have to pass ID instead of value as text (name).

  • Can you please accept the answer & make it upvote so others can get benefit from it by identifying that it is working solution? – Hardik Jan 2 at 7:37
  • how about multiple values ?? i applied the same formula but it dint work @hardik – Sunil C Bhuyar Jan 2 at 9:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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