Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Trouble fetching nested item in an array to filter on, any tips appreciated greatly

(0) ShareShare
ReportReport
Posted on by

Hello all, nice to meet you.

 

Im new to flow, coming from ansible. Love flow and its capabilities but i have hit a snag, im hoping someone can help me.

I dont expect a finished solution, but i would be grateful for any help as im busting my brain with this for past couple of days and cant get it to work.

 

I have a JSON like so with thousands of entries, this one is truncated for convinicence:

 

[
    {
        "networkId": "N_566327XXX1874625",
        "serial": "Q2TN-XXXX-CW29",
        "uplink": "wan1",
        "ip": "8.8.8.8",
        "timeSeries": [
            {
                "ts": "2021-01-14T15:08:47Z",
                "lossPercent": 0.0,
                "latencyMs": 27.7
            }
        ]
    },
    {
        "networkId": "N_56632XXXX141874660",
        "serial": "Q2TN-XXXX-35S4",
        "uplink": "wan1",
        "ip": "8.8.8.8",
        "timeSeries": [
            {
                "ts": "2021-01-14T15:08:55Z",
                "lossPercent": 0.0,
                "latencyMs": 4.8
            }
        ]
    }
]
 
Im trying to first filter out all entries that have lossPercent not equal to 0 or 100
And in the end end up with something like:
[
{
"serial": "Q2TN-XXXX-35S4"
"lossPercent": 9 
"latencyMs": 4.8
},
{
"serial": "Q2TN-YYY-35S4"
"lossPercent": 5 
"latencyMs": 4.8
}
]
 
 I understand i have to use looping and filter array, but just cant seem to get it right.
Not sure how to "get to" the item lossPercent so far deep in 😄
 
Appreciate any pointers, all.
 
  • tom_riha Profile Picture
    10,127 Most Valuable Professional on at
    Re: Trouble fetching nested item in an array to filter on, any tips appreciated greatly

    Hello @zpavlovic ,

    I think you'll need an array variable to store the results and process the JSON in 2 steps with 2 'Parse JSON' actions:

    • Parse JSON: parse the main JSON with all the data
    • Apply to each: for each object from the 'Parse JSON'
      • Parse JSON 2: parse only the 'timeSeries' part in each of the objects from the first 'Parse JSON'
      • Apply to each 2: for each 'timeSeries' part in each the object
        • Condition: if lossPercent is 0 or 100
          • True: Append to array variable: build the output object using 'serial' from 'Parse JSON' and 'lossPercent' + 'latencyMs' from 'Parse JSON 2' and add it to the array variable
          • False: Do nothing

    After the original 'Apply to each' the array variable should contain what you need.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1