cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Harbie
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
CFernandes
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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (51,280)