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?
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,
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional