Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Custom connector - graph query

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I'm working on a PowerApp that will display a given users assigned licenses (https://docs.microsoft.com/en-us/graph/api/user-list-licensedetails?view=graph-rest-1.0&tabs=http) and ultimately allow you to assign new licenses to them.  My custom connector lists the users, and when you click on a user, it sets the guid ("id") of the user to a variable and then the connector url is https://graph.microsoft.com/v1.0/users/{UserID}/licensedetails.  UserID should be replaced with the user's guid ("id").

 

I've tried using the sample json from the docs and the output json from my test in graph explorer, and it seems my json isn't right - i'm not getting the values I want.  I mainly just want the info in the "servicePlans", but it's getting everything but those values.

 

{ "value": [ { "servicePlans": [ { "servicePlanId": "servicePlanId-value", "servicePlanName": "servicePlanName-value", "provisioningStatus": "provisioningStatus-value", "appliesTo": "appliesTo-value" } ], "skuId": "skuId-value", "skuPartNumber": "skuPartNumber-value", "id": "id-value" } ] }

 

Any ideas?

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    on at
    Re: Custom connector - graph query

    Hi @russrimm ,

    Could you please share a bit more about your scenario?

    Do you want only to get the "servicePlans" part (array) within your custom action response? Right?

     

    Based on the needs that you mentioned, I think you have some misunderstanding with the JSON Object response returned from the licenseDetails action.

    Actually, the licenseDetails action (https://graph.microsoft.com/v1.0/users/{UserID}/licensedetails) returned is a collection of licenseDetails objects, which has a fixed JSON Schema structure as below:

    {
     "value": [
     {
     "servicePlans": [
     {
     "servicePlanId": "servicePlanId-value",
     "servicePlanName": "servicePlanName-value",
     "provisioningStatus": "provisioningStatus-value",
     "appliesTo": "appliesTo-value"
     }
     ],
     "skuId": "skuId-value",
     "skuPartNumber": "skuPartNumber-value",
     "id": "id-value"
     }
     ]
    }

    The above JSON Schema is fixed, which could not be changed. So you could not change the JSON schema in your custom connector, otherwise, it may cause a Response Incompatible issue on your side.

     

    Within your canvas app, if you want to acquire the "servicePlans" part from your custom connector action response, you could consider take a try with the following workaround:

    ClearCollect(
     servicePlansCollection,
     First('Custom Connector Name'.'Operation Name'.value).servicePlans
    )

    Note: The 'Custom Connector Name' represents your custom connector name, and the 'Operation Name' represents the Operation name you defined for the licenseDetails action (https://graph.microsoft.com/v1.0/users/{UserID}/licensedetails) in your custom connector, please replace them with actual value from your side.

    After you execute above formula, the "servicePlans" part (array) would be stored into the servicePlansCollection, you could preview it inside your canvas app directly.

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard