{"id":2462,"date":"2026-02-02T12:50:50","date_gmt":"2026-02-02T11:50:50","guid":{"rendered":"https:\/\/blog.kodono.info\/wordpress\/?p=2462"},"modified":"2026-02-02T12:50:50","modified_gmt":"2026-02-02T11:50:50","slug":"set-people-picker-field-in-a-sharepoint-list-item-using-microsoft-graph","status":"publish","type":"post","link":"https:\/\/blog.kodono.info\/wordpress\/2026\/02\/02\/set-people-picker-field-in-a-sharepoint-list-item-using-microsoft-graph\/","title":{"rendered":"Set People Picker field in a SharePoint List Item using Microsoft Graph"},"content":{"rendered":"<p>When we want to use MS Graph to add an item into a SharePoint List that contains a People Picker, then here what needs to be done:<\/p>\n<ol>\n<li>Retrieve the Site ID for the root site collection, using <code>https:\/\/graph.microsoft.com\/v1.0\/sites\/[CORP].sharepoint.com:\/sites\/MySiteCollection<\/code><\/li>\n<li>Retrieve the Site ID for the target end website, using <code>https:\/\/graph.microsoft.com\/v1.0\/sites\/[CORP].sharepoint.com:\/sites\/MySiteCollection\/MyParentSiteWeb\/MyTargetWebsite\/<\/code><\/li>\n<li>Use the user&#8217;s email address to retrieve the SharePoint User ID of that person from the User Information List, using <code>https:\/\/graph.microsoft.com\/v1.0\/sites\/[ROOT_SITE_ID]\/lists\/User%20Information%20List\/items?expand=fields&#038;filter=fields\/EMail%20eq%20'[ENCODED_EMAIL]'&#038;top=1\"<\/code> \u2013 the email must be encoded to be passed in an URL<\/li>\n<li>If the user doesn&#8217;t exist in this SharePoint yet, then you have to use the REST API call to <code>https:\/\/[CORP].sharepoint.com\/sites\/MySiteCollection\/MyParentSiteWeb\/MyTargetWebsite\/_api\/web\/ensureUser<\/code> with the payload <code>{\"logonName\":\"user_email@corp.com\"}<\/code> \u2013 you should get the User ID this time<\/li>\n<li>Then we need to get the List ID of where we want to add the item, using <code>https:\/\/graph.microsoft.com\/v1.0\/sites\/[TARGET_SIDE_ID]\/lists\/[LIST_NAME_ENCODED]<\/code><\/li>\n<li>Finally, we can add the item using <code>https:\/\/graph.microsoft.com\/v1.0\/sites\/[TARGET_SIDE_ID]\/lists\/[TARGET_LIST_ID]\/items<\/code> with a specific value depending if it&#8217;s a multi-selection people picker field or not \u2013 let&#8217;s say the internal name for my field is &#8220;Requestor_x0020_Name&#8221;, then I have to append &#8220;LookupId&#8221; to this name:\n<ul>\n<li>for a single selection field, the payload contains:\n<pre class=\"brush:json\">{\"Requestor_x0020_NameLookupId\": \"[USER_ID_FOUND_WITH_GRAPH]\"}<\/pre>\n<li>for a multi-selection field we have to pass the odata type, and put the User ID into an array, then the payload contains:\n<pre class=\"brush:json\">{\r\n\"Requestor_x0020_NamesLookupId@odata.type\":\"Collection(Edm.String)\",\r\n\"Requestor_x0020_NamesLookupId\": [ \"[USER_ID_FOUND_WITH_GRAPH]\" ]\r\n}<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>When we want to use MS Graph to add an item into a SharePoint List that contains a People Picker, then here what needs to be done: Retrieve the Site ID for the root site collection, using https:\/\/graph.microsoft.com\/v1.0\/sites\/[CORP].sharepoint.com:\/sites\/MySiteCollection Retrieve the Site ID for the target end website, using https:\/\/graph.microsoft.com\/v1.0\/sites\/[CORP].sharepoint.com:\/sites\/MySiteCollection\/MyParentSiteWeb\/MyTargetWebsite\/ Use the user&#8217;s email address to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","hide_page_title":"","footnotes":""},"categories":[170,13],"tags":[123,152],"class_list":["post-2462","post","type-post","status-publish","format-standard","hentry","category-english","category-niveau-intermediaire","tag-english","tag-niveau-intermediaire"],"_links":{"self":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/comments?post=2462"}],"version-history":[{"count":5,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2462\/revisions"}],"predecessor-version":[{"id":2467,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2462\/revisions\/2467"}],"wp:attachment":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/media?parent=2462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/categories?post=2462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/tags?post=2462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}