Access members@delta from group delta query

Isuru 0 Reputation points
2024-06-24T22:00:00.81+00:00

Hi There,

I'm trying to get the group member changes from group.delta query

But i cant access "members@delta" any ideas ?

This is what i'm trying to do

string deltaLink = deltaPage.OdataDeltaLink.ToString();
var groupResult = await graphClient.Groups.Delta
   .WithUrl(deltaLink)
   .GetAsDeltaGetResponseAsync();
foreach (var group in groupResult.Value)
{
    var add = group.AdditionalData.TryGetValue("members@delta", out var membersDelta2);
    if (group.AdditionalData.TryGetValue("members@delta", out var membersDelta) &&
        membersDelta is JsonElement changedMembers &&
        changedMembers.ValueKind == JsonValueKind.Array)//verify that the members delta is present
    {
    }
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,326 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,037 questions
Microsoft Entra
{count} votes

1 answer

Sort by: Most helpful
  1. Isuru 0 Reputation points
    2024-06-24T23:20:20.6533333+00:00

    Serializing the UntypedArray object to a string using KiotaJsonSerializer then deserializing back will resolve this

    if ((group?.AdditionalData.TryGetValue("members@delta", out var value) ?? false)
        && value is UntypedArray untypedArray)
    {
        var tempJson = KiotaJsonSerializer.SerializeAsString(untypedArray);
        
    }
    
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.