Adding users to PersonOrGroup fields in a SharePoint list with Graph

Matt Tebbs 0 Reputation points
2024-05-26T21:28:33.1566667+00:00

To add a user to a PersonOrGroup field in a SharePoint list you need to use the user id obtained from the site internal user list. However if the user has never interacted with the site they won't exist in site user list. There doesn't appear to be any way with Graph APIs to add a user who isn't in the site user list. Or am I missing something?

Am trying to rewrite a script to use Graph only & this is a show stopper.

There is a SharePoint API ensureuser that returns the user object form the site's user list and adds them if they don't exist, just no equivalent functionality in Graph as far as I can tell.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,078 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Hitesh Pachipulusu - MSFT 475 Reputation points Microsoft Vendor
    2024-06-03T14:18:57.6833333+00:00

    Hello

    After research, it has been found that the Graph API does not return the user object from the site's user list, nor does it add them to site if they are not present.

    So, we suggest that you can submit a feature request idea using this support link, which will be monitored by Microsoft team and make the enhancements to Microsoft Graph APIs.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments