I have a sharepoint site with 1k+ members. This is a public group/site within our tenant. Within that site I have a list where I am collecting feedback. The list has several columns, 2 of which are of type PersonOrGroup (one allows for multi-selection, the other doesnt).
On a desktop c# application I am trying to populate items in this list and I am able to add items in regular columns but I am struggling to make it work for the PersonOrGroup columns. I am using MSFT Graph API with the proper permissions. From what I gathered online these columns hold lookupIDs of users not an actual user. This lookupID corresponds to an internal "hidden" User Information List within the site that contains all the users and their corresponding ID.
Based on this, I was able to find this list and its listID. When I read this list, I do not find all the user members in the group? An example of the items I get when I look at this list is below:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('xxx')/lists('xxxx')/items",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/sites/xxx/lists/xxxx/items?$skiptoken=UGFnZWQ9VFJVRSZwX0lEPTIwMw",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET sites('<key>')/lists('<guid>')/items?$select=contentType,sharepointIds",
"value": [
{
"@odata.etag": "\"73020bf1-00c2-43ce-8f35-ca76febdde60,9\"",
"createdDateTime": "2020-07-12T05:50:47Z",
"eTag": "\"73020bf1-00c2-43ce-8f35-ca76febdde60,9\"",
"id": "3",
"lastModifiedDateTime": "2023-02-03T17:55:43Z",
"webUrl": "https://xxx/sites/xxx/_catalogs/users/3_.000",
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"lastModifiedBy": {
"user": {
"displayName": "System Account"
}
},
"parentReference": {
"id": "xxx",
"siteId": "xxx"
},
"contentType": {
"id": "0x010B00632ECBA8D44FE94497E4391263B20146",
"name": "SharePointGroup"
}
},
{
"@odata.etag": "\"664b3e21-e378-42ce-aaae-e517eab3e4e0,22\"",
"createdDateTime": "2020-08-24T01:23:13Z",
"eTag": "\"664b3e21-e378-42ce-aaae-e517eab3e4e0,22\"",
"id": "18",
"lastModifiedDateTime": "2023-10-03T07:08:57Z",
"webUrl": "https://xxx/sites/xx/_catalogs/users/18_.000",
"createdBy": {
"user": {
"email": "xxx@xx.com",
"id": "f56f4408-6137-48e1-8f19-3b371f5991d1",
"displayName": "xx, xx"
}
},
"lastModifiedBy": {
"user": {
"displayName": "System Account"
}
},
"parentReference": {
"id": "aca980ac-e2d5-4e7c-be3f-529cb63f4e91",
"siteId": "xx"
},
"contentType": {
"id": "0x010A00E90A5A3773F58C45B64E73AA5366410D",
"name": "Person"
}
},..
Based on the data above, I would loop through the items and check when the contentType -> name = Person, then look at createdBy -> user -> email and check if this is the email of the user I am looking for. However I am noticing that not all users are in this list (I cant even find myself). It is not an issue with pagination, I am going through all the data and request urls.
So based on all of this, how am I able to add users to the PersonOrGroup column based on their email?