Apr 19 2021 11:20 PM - edited Apr 20 2021 01:02 AM
I'm trying to create a sharepoint list view item with one column of type personandgroup using graph API. The person or group is not part of sharepoint but its available in Microsoft 365. But Microsoft graph API creates item only when i pass PersonAndGroup value as sharepoint id if i try to pass claim it does not work. As users and groups have not logged in or connected "user Information List" does not have Users I'm trying to populate and not able to create a new List item.
Following is working without any issue as long as user id exists in the "user Information List"
var listItem = new Microsoft.Graph.ListItem
{
Fields = new FieldValueSet
{
AdditionalData = new Dictionary<string, object>()
{
{"UsernameLookupId", "14"}, //PersonAndGroup where I'm passing sharepoint user Id
{"groupname", "Avengers"},
{"Title" , "Captain America"}, //Permission
{"Role", "User" },
{"GroupId" , ""},
{"UserId" ,""}
}
}
};
Is there anyway to populate lookup (personandgroup) value without sharepoint userid something like below
var listItem = new Microsoft.Graph.ListItem
{
Fields = new FieldValueSet
{
AdditionalData = new Dictionary<string, object>()
{
{"Username", { "user": {"id": "{UserId}"} }
}
}
};
Mar 24 2022 08:10 PM
@Chitrarasan I really need to know this too. I am trying to migrate an old list from Sharepoint 2013 to a new list that has PersonOrGroup fields.
Jun 10 2022 12:08 PM
Jun 10 2022 12:11 PM