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 Apps / How to extract field f...
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

 

Categories:
I have the same question (0)
  • AL-23070108-0 Profile Picture
    on at

    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)}
    )
    }
    )
    }
    )
    )

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    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

    Thank you for your reply. 

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,070

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 608

Last 30 days Overall leaderboard
Liquid error: parsing "/forums/thread/details/?threadid=%27nvOpzp;%20AND%201=1%20OR%20(%3C%27%22%3EiKO))," - Too many )'s.