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 / Power Automate JSON Pa...
Power Automate
Unanswered

Power Automate JSON Parsing Assistance

(0) ShareShare
ReportReport
Posted on by 6

I have a flow that is trying to take Azure DevOps query, store it as JSON and then extract individual json objects one by one. Here is my flow: 

MyFlowMyFlow

This flow usually works great but for the following reason this version of the flow is failing: 

 

See the json object that I have from Azure DevOps is a little weird:
[

{
    "System.Id"756,
    "System.WorkItemType""User Story",
    "System.State""Done",
    "System.Title""Sample user story ",
    "Custom.UserRequestID""1594"
}

]

When I try to extract data using item().Id, I get a name mismatch error. When I try item().['System.Id'], I get invalid expression error. If i do, item().system.id, then i get object system not found error. 

Can anyone please help? 

 

P.S. : Please do not provide a solution that has apply to each loop. I would like to understand how to handle this syntax with item() expressions. However, triggerBody expressions instead of item as solutions are welcome since they have the same issue in syntax. 

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Since the JSON has square brackets around it you are dealing with an array, not an object.  That's why you normally get an apply to each.  But you can use an integer index to get the individual records.  So if what you posted above is in the parse JSON this would get you system.id

    body('Parse_JSON')[0]?['System.Id']
  • suby_thakurta Profile Picture
    6 on at

    I am sorry but this solution doesn't work. My objective is to extract individual items from json parse. If the key names did not have System. or custom. in them, item works like magic. So I need to know what is the correct syntax for item() when JSON names are like System.ID or Custom.ID. Hope you understand my predicament. 

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    I put the sample you posted in a Parse JSON and the code I posted is what retrieves the ID value.  What you posted is an array so you can't access an item without an index.

  • suby_thakurta Profile Picture
    6 on at

    Can you please share a screenshot of your flow? I am still getting an error. I understand it is an array and that is why I was looking into item(). That's not the issue. It is the syntax which is causing a problem as my key is named as System.Id. If it was just Id, then my solution works. It would be a great favor, if you can share a screenshot of your flow. Thank you! 

  • NorthernChuck Profile Picture
    156 on at

    @suby_thakurta if you are trying to replicate a foreach() loop, the you need to use "Apply to Each" condition. 
    I'm looking at your screenshot and I'm questioning all the initializes and the parse json in between the Azure DevOps tiles and your select. There's always 1001 to skin-a-cat, but I'd look at doing your select after the DevOps tiles. The UI should auto-insert an "Apply to Each" 

  • suby_thakurta Profile Picture
    6 on at

    I guess I was not clear with the question. My objective is to extract an item from an array that has system.id as the key using item() expression. I want to know the syntax for that. I already am able to build the solution using create CSV table or trigger expressions. And yes, to pull the items from the array, for each will work great. All these are great solutions but I am looking for a syntax as a solution (as I have mentioned in my problem statement) and not suggestions on how to run the flow. But thank you so much for your efforts. I am extremely thankful for your suggestions.  

  • NorthernChuck Profile Picture
    156 on at

    Then @Pstork1 's comments is where you loop back to; you have an array to deal with. 
    What you are asking for is after the index number. You have to tell the flow  which index number inside the array you are dealing with.
    In other words, you have to identify 'where' you are in the array, then your object and then you can deal with items. I did the same thing as @Pstork1 and came to the same result, I had to identify where I was in the array, position 0, then I got your data. 

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    You can only use the item() notation inside a loop of some kind, like an apply to each loop.  When not inside the loop you access the array, that's body('Parse_Json'). And then specify the item you want with an integer index [0].  Then add the selector for the value ?['system.Id'].  Here's the flow

    image.png

  • Verified answer
    Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    You can only select an item using an index integer, not a key.  Once you have the item you can select the property using the key name.  You can also use the key value and the key to filter the array.  But you still end up with 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

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