1

We're trying to a user in a list item but it's not working. In fact, when we validate the people picker, user is detected and we can validate our form. enter image description here

But when we edit the item, the user is not recognized, and we can't save the form anymore: enter image description here

When we visit the UserInfoList, we can't find this user, but when we use a REST Api request, user data is returned with his Id : enter image description here

Any idea about what's happening ?

1

I finally solved the issue. I don't know, till now, why user was not visible in User Information List in the browser but was visible in the json returned by the rest api request, but using the EnsureUser method solved the problem. This is the script that I've used :

function ensureUser(webUrl,loginName)
{
   var payload = { 'logonName': loginName }; 
   return $.ajax({
      url: webUrl + "/_api/web/ensureuser",
      type: "POST",
      contentType: "application/json;odata=verbose",
      data: JSON.stringify(payload),
      headers: {
         "X-RequestDigest": $("#__REQUESTDIGEST").val(),
         "accept": "application/json;odata=verbose"
      },
     success: function(){alert('success');},
     failure: function(){alert('failure');}
   });  
}


var loginName = '<LoginName>'
ensureUser(_spPageContextInfo.webAbsoluteUrl,loginName);

After that, the user was visible again on the User Information List browser UI and we could add him to the people picker and find him after editing the same item.

  • After your answer I remember EnsureUser makes sure the entry is made in the User Information List. – Arsalan Adam Khatri Feb 27 '18 at 6:56
0

To troubleshoot the issue, you could start full synchronization in user profile service application in central administration.

And run the two timer jobs “User Profile to SharePoint Full Synchronization” and “User Profile to SharePoint Quick Synchronization” in the Central administration to sync the user information between user information list and user profile service application.

  • Thanks @Amy_SPWX for your answer, but we've already done this and nothing happened. – KhalilG Feb 20 '18 at 8: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.