web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Custom connector - gra...
Power Apps
Unanswered

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:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard