Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

How to extract field from 3-levels Nested json on PowerApps.

(0) ShareShare
ReportReport
Posted on by

Json String:

[
{
"Cells": {
"results": [
{
"__metadata": {
"type": "SP.KeyValue"
},
"Key": "WorkId",
"Value": "39041547530843714",
"ValueType": "Edm.Int64"
},
{
"__metadata": {
"type": "SP.KeyValue"
},
"Key": "Title",
"Value": "Titls-1",
"ValueType": "Edm.String"
}
]
},
{
"Cells": {
"results": [
{
"__metadata": {
"type": "SP.KeyValue"
},
"Key": "WorkId",
"Value": "39041547530854781",
"ValueType": "Edm.Int64"
},
{
"__metadata": {
"type": "SP.KeyValue"
},
"Key": "Title",
"Value": "Titls-2",
"ValueType": "Edm.String"
}
]
}
]

 

I want to extract and show fields on gallery of PowerApps like that. 

Line1 : WorkId, Title

Line2 : WorkId, Title

....

 

I t

 

  • AL-23070108-0 Profile Picture
    on at
    Re: How to extract field from 3-levels Nested json on PowerApps.

    Thank you for your reply. 

  • Verified answer
    v-jefferni Profile Picture
    on at
    Re: How to extract field from 3-levels Nested json on PowerApps.

    Hi @Alucard_0079 ,

     

    First of all, the JSON string you provided is incorrect. I modified it as follows (added two "}" for each "Cells"):

    [
    {
    "Cells": {
    "results": [
    {
    "__metadata": {
    "type": "SP.KeyValue"
    },
    "Key": "WorkId",
    "Value": "39041547530843714",
    "ValueType": "Edm.Int64"
    },
    {
    "__metadata": {
    "type": "SP.KeyValue"
    },
    "Key": "Title",
    "Value": "Titls-1",
    "ValueType": "Edm.String"
    }
    ]
    }
    },
    {
    "Cells": {
    "results": [
    {
    "__metadata": {
    "type": "SP.KeyValue"
    },
    "Key": "WorkId",
    "Value": "39041547530854781",
    "ValueType": "Edm.Int64"
    },
    {
    "__metadata": {
    "type": "SP.KeyValue"
    },
    "Key": "Title",
    "Value": "Titls-2",
    "ValueType": "Edm.String"
    }
    ]
    }
    }
    ]

     

    Secondly, note that the WorkId and Title are all in Key column, so the result will be different from what you may think:

    ClearCollect(
     var_result,
     ForAll(
     Ungroup(
     ForAll(
     Table(ParseJSON(TextInput1.Text)) As AA,
     {results: Table(AA.Value.Cells.results)}
     ),
     "results"
     ),
     {Key: Text(ThisRecord.Value.Key)}
     )
    )

    vjefferni_0-1678873641139.png

     

    Best regards,

  • AL-23070108-0 Profile Picture
    on at
    Re: How to extract field from 3-levels Nested json on PowerApps.

    I tried to use PowerFx ,but failed.

    Set(
    var_result,
    ForAll(
    Table(ParseJSON(Label2.Text)),
    {
    Cells: ForAll(
    RenameColumns(
    Table(
    Index(
    Table(Value.Cells),
    1
    ).Value
    ),
    "Value",
    "SubValue"
    ),
    {
    Key: ForAll(
    Table(SubValue),
    {Key1: Text(SubValue.results)}
    )
    }
    )
    }
    )
    )

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,011 Most Valuable Professional

Leaderboard