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 Platform Community / Forums / Power Automate / Parsing json - get fir...
Power Automate
Answered

Parsing json - get first item of an array

(3) ShareShare
ReportReport
Posted on by 27
From an HTTP get call I'm getting this json back:
 
[{"Value": "BRUUL","Id": 39318,"Brussels": false}]
 
I simply want to take the value for the Id property of the first item in the array.
 
I've been reading up on articles I found via several search engines, trying with compose and set variable but either it goes into a apply each block, which I don't want, or I keep on getting the entire above string sent back to my Power Virtual Agent.
Categories:
I have the same question (0)
  • Verified answer
    DeepakS Profile Picture
    2,301 Most Valuable Professional on at

    Hi @KrisvanderMast 

     

    After you parse your JSON using parse JSON action use following expression :

    body('Parse_JSON_2')[0]['Id'] this will give you id of first item

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

     

  • KrisvanderMast Profile Picture
    27 on at

    Hi,

     

    that gives me the following error:

     

    Correct to include a valid reference to 'Parse_JSON_2' for the input parameter(s) of action 'Initialize_variable'.

     

     

  • DeepakS Profile Picture
    2,301 Most Valuable Professional on at

    Hi @KrisvanderMast 

     

    Parse_JSON_2 is the action name in my FLOW, in your flow you should use action name that in your flow. share a screen capture of your flow i will let you know what to use.

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

     

  • KrisvanderMast Profile Picture
    27 on at

    Did a rename of my action and it worked. 

     

    Is there some overview/list of functions like body() and the likes I can take a look at and learn?

  • DeepakS Profile Picture
    2,301 Most Valuable Professional on at

    Hi @KrisvanderMast 

     

    Checkout following link:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

  • _Judy_ Profile Picture
    109 on at

    Thank youuuuuu. You are my hero. 😀

  • Chriddle Profile Picture
    8,713 Super User 2026 Season 1 on at
  • JS-15030026-0 Profile Picture
    2 on at
    I tried the recommended solution above but it is no working for me
     
    I am using a Compose action with this content       body('ParseJSON')[0]['RunStatus']
     
    Here is output of previous ParseJSON step
    {
      "Table1": [
        {
          "RunStatus""Succeeded",
          "JobMessage""The job succeeded.  The Job was invoked by Schedule 14 (Monthly ACTIVE_INDIVIDUALS).  The last step to run was step 8 (SP_MTH_ACTIVE_INDIV7)."
        }
      ]
    }
     
    I get this error message:
    Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language expression 'body('ParseJSON')[0]['RunStatus']' cannot be evaluated because property '0' cannot be selected. Object properties can only be selected by names. 
     
    What am I doing wrong?
  • Chriddle Profile Picture
    8,713 Super User 2026 Season 1 on at
    In your case, body('ParseJSON') is not an array.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 241 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 179

#3
Haque Profile Picture

Haque 159

Last 30 days Overall leaderboard