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

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

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard