Microsoft Fabric Data Factory - MS Graph API - Groups/Users - Unable to reference response paging attribute

Laron Lemon 0 Reputation points
2024-10-18T14:59:57.8433333+00:00

I am trying to get all groups and users from MS Graph. These both use paging (limit 100 records per page). To get the next page I need to reference an attribute in the previous repsonse. However, the attribute has '@' and '.' in it... how do I reference this attribute?

 

Attribute: "@odata.nextLink"

 

Activity Expression: 

@activity('Lookup_Group_IDs_copy1').output.value[0].'@odata.nextLink' <-- this does not work

@activity('Lookup_Group_IDs_copy1').output.value[0]['@odata.nextLink']

 ^^ this does not work either...

Cheers,

 

Laron

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,380 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,924 questions
Microsoft Fabric Training
Microsoft Fabric Training
Microsoft Fabric: A Microsoft unified data platform.Training: Instruction to develop new skills.
52 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 26,971 Reputation points
    2024-10-18T20:43:35.7166667+00:00

    Ensure that the Lookup_Group_IDs_copy1 activity returns a JSON response and that the @odata.nextLink is indeed within the value array as expected. You can inspect the full output by running a debug pipeline and checking the full activity output in the logs.

    If the @odata.nextLink is not inside value[0] but at a different level in the JSON, adjust the path accordingly. For example, if the @odata.nextLink is at the root of the response (outside the value array), you might need something like this:

    
     @activity('Lookup_Group_IDs_copy1').output['@odata.nextLink']
    
    

    If there's a chance that the @odata.nextLink key might be missing or null, you can use the coalesce function to provide a default value in case it is not found. For example:

     @coalesce(activity('Lookup_Group_IDs_copy1').output['@odata.nextLink'], 'default_value')
    

    Try the above steps and see if you can pinpoint the exact location of the @odata.nextLink attribute in your response. Let me know how it goes!

    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.