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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Skip json first level

(0) ShareShare
ReportReport
Posted on by

Hi

After http post, i get a body like this :

 
    "body": [
        "OK",
        [
            {
                "DESCRIPCION": "XXXXXX",
                "NAME": "YYYYY"
             },
           
  {
                "DESCRIPCION": "XXXXXX",
                "NAME": "YYYYY"
             },
        ]
    ]
 
The first node reprents the status code, and i only want to iterate the items after this level.
I have tried to parse json, but return full json and if i use foreach statement and ,for example 'create item in sharepoint action' , only return the ok from first level.
The idea is to skip the first level (OK) and go through all the elements of the json creating in SP items
 
Thanks 
 
 
Thanks 
Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    Are you sure that's the exact JSON you get? It's not valid the way it is. For it to be valid JSON you need to have key/value pairs for everything.

  • DF-07111556-0 Profile Picture
    on at

    Hi, thanks for your attention.

    Yes i think so. After HTTP action i review the output and the result is :

     

    {
        "statusCode": 200,
        "headers": {
            "Server": "nginx/1.18.0,(Ubuntu)",
            "Date": "Sun, 11 Dec 2022 12:30:33 GMT",
            "Transfer-Encoding": "chunked",
            "Connection": "keep-alive",
            "Cache-Control": "max-age=0",
            "Content-Type": "application/json",
            "Expires": "Sun, 11 Dec 2022 12:30:33 GMT",
            "Content-Length": "1088"
        },
        "body": [
            "OK",
            [
                {
                    "DESCRIPCION": "acbdc",
                    "NOMBRE.PROYECTO": "yyyy11",                
                    "FECHA": "2022-11-21",
                    "CODIGO PROYECTO": "10205811"
                },           
    {
                    "DESCRIPCION": "aszxfdf",
                    "NOMBRE.PROYECTO": "yyyy22",                
                    "FECHA": "2022-11-21",
                    "CODIGO PROYECTO": "10205822"
                },
            ]
        ]
    }
     
     
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    Ah, Ok. See example below where Compose contains your raw JSON and Compose 2 has the expression to extract the array of objects from the body element using the following expression.

     

    outputs('Compose')?['body'][1]

     

    grantjenkins_0-1670764776145.png

  • DF-07111556-0 Profile Picture
    on at

    Thats nice!! thank you very much 😉

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 456

#3
11manish Profile Picture

11manish 352

Last 30 days Overall leaderboard