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

Community site session details

Session Id : PgC3h3IQSyCgch5E26HRES
Power Automate - Building Flows
Unanswered

Licensing report from Office 365 users

Like (0) ShareShare
ReportReport
Posted on 13 Dec 2022 14:33:39 by

Hi, 

 

I aim to build a licensing report flow that invokes an HTTP request to Office 365, with some filters, and returns useful info like username, title, phone number and assigned licenses. The goal is to get this data into a sharepoint list for name, e-mailaddress, phone number and licenses. 

 

The output is json parsed to get dynamic content. Since the JSON produces nested arrays I am having issues knowing how to handle the output. This is the JSON putput: 

 

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,mobilePhone,mail,jobTitle,assignedLicenses)",
"@odata.count": 9,
"value":
{
"id": "86a7efac-f250-42db-8bdc-xxxxxxxxxx",
"displayName": "Elisabet XXXXXXXX",
"mobilePhone": "+XX XX XX XX XX",
"mail": "elisabet@XXXXXXXX.example",
"jobTitle": "Administration / Ekonomi",
"assignedLicenses": [
{
"disabledPlans": [
"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"
],
"skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900"
},
{
"disabledPlans": [],
"skuId": "b05e124f-c7cc-45a0-a6aa-8cf78c946968"
}
]
}

The issues I'm having are mostly centered around "assignedlicenses":

1. I need to rename the skuID-values to readable text to their corresponding correct name and since different licenses are in different arrays the renaming needs to be done for all instances of every skuID.

2. Each user can have several licenses and each license is in a different array. I would ideally want to join all license arrays into one, and in that process filter away the "disabled" plans which is unuseful anyway. This would make the extraction of the data easier.


Adding an image of the flow, please get back with any questions for clarification. 
In the last loop I am testing a select function where I replace the value of "skuid" to the corresponding name of the license: 

replace(item()['skuId'],'6fd2c87f-b296-42f0-b197-1e91e994b900','Office 365 E3')
I have tried adding multiple expressions for the different license skuIDs we have but the ouput from the select-function is still weird, only generating one renaming. 
 
power automate.PNG
Any help appreciated! 

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete