1

I need to update a person field in a list using a result from a people search (sourceid=B09A7990-05EA-4AF9-81EF-EDFAB16C4E31). The search works great, but does not return the person's ID that I need to use to update the person field in the list.

I know I can get the ID for site users using the /_api/web/siteusers REST endpoint (and have implemented this successfully), but I need to be able to get the ID for any user in the tenancy, not just this site's users.

Any help would be greatly appreciated.

3

The persons id is per site, because the persons id is the id of the person's entry in the site's "User Information List".

That's why you won't get the Id of the Person using search (because the search is working over more than one site collection, where the Person can have different id's).

Also, the "User Information List" just holds only users which has already visited the site or were otherwise directly mentioned (eg, being selected in a People-Picker). If that´s not the case, there is no id for the user.

  • Thank you for your answer! I was not aware of this and it forced me to reconsider the storage structures. I realized that there was no real requirement for the person field and changed it to a text field to just store the name returned from my search. Problem solved :-) – Johan Alberts Jun 17 '15 at 10:42

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.