cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Send an HTTP request to SharePoint JSON Output to an Array

WhenI run "Send an HTTP request to SharePoint" I get the output below. Note that the output is dynamic hence can be more or less than two entries. {
  "value": [
    {
      "Email""adele@xxxxxxxxxxxxxx.onmicrosoft.com"
    },
    {
      "Email""sayven@vvvvvvvvvvv.OnMicrosoft.com"
    },
    {
      "Email""jons@xxxxxxxxxxx.onmicrosoft.com"
    }
  ]
}
\SCHEMA
{
    "type""object",
    "properties": {
        "value": {
            "type""array",
            "items": {
                "type""object",
                "properties": {
                    "Email": {
                        "type""string"
                    }
                },
                "required": [
                    "Email"
                ]
            }
        }
    }
}

question:
How can I convert this JSON Object into an Array?
1 ACCEPTED SOLUTION

Accepted Solutions

@Harbie  No worries... The only change you will need to make is initialize a variable of type array, and append the array variable with the value. See screenshot below:

 

CFernandes_0-1601453386005.png

 

The JSON Schema was generated you sample.

 

{
    "type": "object",
    "properties": {
        "value": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "Email": {
                        "type": "string"
                    }
                },
                "required": [
                    "Email"
                ]
            }
        }
    }
}

 

Flow Run:

 

CFernandes_1-1601453483100.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

 

View solution in original post

5 REPLIES 5
Super User III
Super User III

@Harbie 

 

Hey Mate,

 

I assume you are trying to get value from the array, something like the screenshot below:

 

CFernandes_2-1601426496133.png

 

 

If yes, you can use Parse JSON,> Generate the the JSON schema and directly use the 'Email' the output of Parse JSON asction.

 

CFernandes_5-1601426586460.png

If you want to access individual element then the formula would be.

 

First Value

 

body('Parse_JSON')?['value'][0]?['Email']

 

Similarly Second Value

 

body('Parse_JSON')?['value'][1]?['Email']

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

below is my flow

Harbie_0-1601427234674.png

 

I have another array and I am trying to compare the values provided by HTTP with the values the Array 2. In other to do this, I need the values from Parse JSON to be stored in an array.
@CFernandes 

@Harbie 

 

In Compose you are using the 'Split' operator I guess with reference to error.

 

Please paste the formula that you have used in the compose action. 

@CFernandes I sent that almost same time as your response.

 

If I am correct, the array, in this case, is Value

 

How can I get just the array below from Value?

[
      "adele@m365x685435.onmicrosoft.com"
      "sydney@M365x685435.OnMicrosoft.com"
      "jons@m365x685435.onmicrosoft.com"
]



Thanks for your time @CFernandes .. I am a learner 

@Harbie  No worries... The only change you will need to make is initialize a variable of type array, and append the array variable with the value. See screenshot below:

 

CFernandes_0-1601453386005.png

 

The JSON Schema was generated you sample.

 

{
    "type": "object",
    "properties": {
        "value": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "Email": {
                        "type": "string"
                    }
                },
                "required": [
                    "Email"
                ]
            }
        }
    }
}

 

Flow Run:

 

CFernandes_1-1601453483100.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

 

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (6,463)