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 Automate / Parse JSON from a HTTP...
Power Automate
Unanswered

Parse JSON from a HTTP GET request

(0) ShareShare
ReportReport
Posted on by 4

I'm working with a client that needs automatic reporting on per user licensing based on groups, this can be obtained manually but Automaticaly is causing me a head ache

 

So far I have designed a flow that pulls the users in a group from AAD and once its done that it checks each user against the MS graph   https://graph.microsoft.com/v1.0/users/@{items('Apply_to_each')?['id']}/licenseDetails

 

this element works fine, and Almost gives me what I need, the problem is it response in a JSON format with firstly allot more info than is needed but also in information that needs correlating.. (license type would appear as the below), this is a snip from the response. 

 

            "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "skuId": "71f21848-f89b-4aaa-a2dc-780c8e8aac5b",
            "skuPartNumber": "CPC_B_2C_8RAM_128GB",
            "servicePlans": [
                {
                    "servicePlanId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                    "servicePlanName": "M365_LIGHTHOUSE_PARTNER_PLAN1",
                    "provisioningStatus": "Success",
                    "appliesTo": "Company"
 
I have tried to use Parse JSON to allow me to retreieve the skuID and then using the below Schema but this fire out this error when I try 
 
InvalidJSON. The 'content' property of actions of type 'ParseJson' must be valid JSON. The provided value cannot be parsed: 'Unexpected character encountered while parsing value: L. Path '', line 0, position 0.'. 
 
{
    "type""object",
    "properties": {
        "@@odata.context": {
            "type""string"
        },
        "value": {
            "type""array",
            "items": {
                "type""object",
                "properties": {
                    "id": {
                        "type""string"
                    },
                    "skuId": {
                        "type""string"
                    },
                    "skuPartNumber": {
                        "type""string"
                    },
                    "servicePlans": {
                        "type""array",
                        "items": {
                            "type""object",
                            "properties": {
                                "servicePlanId": {
                                    "type""string"
                                },
                                "servicePlanName": {
                                    "type""string"
                                },
                                "provisioningStatus": {
                                    "type""string"
                                },
                                "appliesTo": {
                                    "type""string"
                                }
                            },
                            "required": [
                                "servicePlanId",
                                "servicePlanName",
                                "provisioningStatus",
                                "appliesTo"
                            ]
                        }
                    }
                },
                "required": [
                    "id",
                    "skuId",
                    "skuPartNumber",
                    "servicePlans"
                ]
            }
        }
    }
}
 
I need to first of all get the skuID and then I need to compare this against information available on https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-service-plan-reference to get the license name but this PARSE JSON doesnt seem to play ball, probably a simple error but hoping any of you could help. 
Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    13,073 on at

    Hi @AaronM-C,

     

    try to get skuID directly:

    body('Send_an_HTTP_request_4')?['value'][0]?['skuId']

     

  • VictorIvanidze Profile Picture
    13,073 on at

    Hi @AaronM-C,

    any comments? 

  • AaronM-C Profile Picture
    4 on at

    Unfortunately that didnt work, MS graph refused the body request
    I managed to get a workaround though

    AaronMC_0-1669899125828.png

     

    AaronMC_1-1669899157375.png

    AaronMC_2-1669899184163.png

     

     

     

  • VictorIvanidze Profile Picture
    13,073 on at

    Hi @AaronM-C,

    could you please confirm this works for you:

    VictorIvanidze_0-1669899684893.png

     

     

  • dperez13 Profile Picture
    432 on at

    how do i use apply to each from the body payload of outlook send an http request. parse json too complicated. i pasted in the schema and i get   schema validation failed and when i try to loop over the body of send an http request for outlook emails i get its an object and not an array so i cant apply to each it. 

     

    please help

    i want to fetch/get all emails in outlook that have flag status eq is completed (green checkmark)

  • VictorIvanidze Profile Picture
    13,073 on at

    Could you share the request?

  • dperez13 Profile Picture
    432 on at

    messages?$filter=flag/flagStatus eq 'Complete' this works in send an http request

     

    this does NOT work in the get emails v3 search query/search filter property

     

    the problem is i do not know how to work with the 'send an http request' from outlook activity as the body is not iterable as its an object not an array and parsing the json is too complicated from the schema. 

  • VictorIvanidze Profile Picture
    13,073 on at

    Parsing the JSON is your only way.

  • dperez13 Profile Picture
    432 on at

    i cant get that to work. any tips

  • dperez13 Profile Picture
    432 on at

    i cant loop over body parse json as its type object, and when i try to loop over body parse json [value] i get that its null

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard