Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 3XyX3K4z/TrrottyNITLNy
Power Apps - Power Apps Governance and Administ...
Unanswered

How to reconstruct the deep nested data using ParsedJson data(deep nested data)

Like (0) ShareShare
ReportReport
Posted on 7 Feb 2025 11:36:39 by 2

Hello PowerApps Experts,

I need help reconstructing a deeply nested JSON structure while preserving its hierarchy in Power Apps. I receive the following JSON:

Sample Data
{
  "@TaxyearCount":"2"
  "TaxYears": [
    {
      "@valid": "true",
      "Year": "2023",
      "YearlyRate": "2.50",
      "coreGrossWagesDetail": {
        "@valid": "true",
        "wageRecords": {
          "@valid": "true",
          "@wageRecordCount": "2",
          "wageRecord": [
            {
              "@valid": "true",
              "benefitClaimInd": "N",
              "coreQuarterlyWages": {
                "@valid": "true",
                "qtr1Amount": "5000.00",
                "qtr2Amount": "5000.00",
                "qtr3Amount": "5000.00",
                "ytdAmount": "15000.00"
              },
              "wagePerson": {
                "@valid": "true",
                "ssn": "501501501",
                "firstName": "John",
                "lastName": "Doe"
              }
            },
            {
              "@valid": "true",
              "benefitClaimInd": "N",
              "coreQuarterlyWages": {
                "@valid": "true",
                "qtr1Amount": "6000.00",
                "qtr2Amount": "6000.00",
                "qtr3Amount": "6000.00",
                "ytdAmount": "18000.00"
              },
              "wagePerson": {
                "@valid": "true",
                "ssn": "502502502",
                "firstName": "Jane",
                "lastName": "Smith"
              }
            }
          ]
        }
      },
      "qtr1Balance": "0",
      "qtr2Balance": "0",
      "qtr3Balance": "0",
      "qtr4Balance": "0"
    },
    {
      "@valid": "true",
      "Year": "2024",
      "YearlyRate": "2.75",
      "coreGrossWagesDetail": {
        "lidva": "true",
        "wageRecords": {
          "@valid": "true",
          "@wageRecordCount": "1",
          "wageRecord": [
            {
              "@valid": "true",
              "benefitClaimInd": "Y",
              "coreQuarterlyWages": {
                "@valid": "true",
                "qtr1Amount": "7000.00",
                "qtr2Amount": "7000.00",
                "qtr3Amount": "7000.00",
                "ytdAmount": "21000.00"
              },
              "wagePerson": {
                "@valid": "true",
                "ssn": "503503503",
                "firstName": "Alice",
                "lastName": "Johnson"
              }
            }
          ]
        }
      },
      "qtr1Balance": "0",
      "qtr2Balance": "0",
      "qtr3Balance": "0",
      "qtr4Balance": "0"
    }
  ]
}
 
 
I need to:
  1. Extract tax years dynamically (2023, 2024, etc.).
  2. Loop through wage records for each tax year.
  3. Reconstruct the JSON in the same nested format while storing it in a record variable.

Challenges:

  • ParseJSON() creates an untyped object, making it hard to loop through.
  • Nested ForAll() doesn't work correctly for deeply nested objects.
  • How do I structure Collections and Variables properly?

Current Attempt (Not Working)

 
Set(TaxData, ParseJSON(YourJSONString));
ForAll(TaxData.TaxYears, { Year: ThisRecord.Year });

I need a structured approach to rebuild the JSON while keeping it formatted like the original.

âś… How can I properly loop through tax years and wage records to reconstruct this JSON?
âś… What is the best way to store this in PowerApps collections or records?

Thanks in advance! 🚀

Categories:
  • Michael E. Gernaey Profile Picture
    35,752 Super User 2025 Season 1 on 07 Feb 2025 at 16:26:01
    How to reconstruct the deep nested data using ParsedJson data(deep nested data)
    Hi,
     
    Just as a start, this isn't a compliance etc type issue and shouldn't be in this location, you will get a lot less people looking at it.
     
    1) are you doing this work in a Canvas App, Power Automate, Model Driven App?
     
    2) I am unsure what you mean Parse Json made it unstructured (So I assume you did this in a Canvas App) but just assuming
     
    3) that is not a deeply nested anything, sorry but it isn't. 
     
    4) where are you getting this data from?
     
    5) store it in a record value, please be super clear with a sample of exactly what you want stored and how you want it to look
     
    6) same for adding things up, just sharing the schema meh, but for each question, make it clear what you need and how you would like it.
     
     

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard

Featured topics

Loading started
Loading complete