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 Automate / Nested array in object
Power Automate
Answered

Nested array in object

(0) ShareShare
ReportReport
Posted on by 6
[
  {
    "Applicant""User 1",
    "Vacation": [
      {
        "Month""December",
        "Duration"4
      },
      {
        "Month""November",
        "Duration"3
      }
    ]
  },
  {
    "Applicant""User 2",
    "Vacation": [
      {
        "Month""December",
        "Duration"4
      }
    ]
  }
]

Current Output:
Applicant Vacation
User 1 [{"Month":"December","Duration":4.0},{"Month":"November","Duration":3.0}]
User 2 [{"Month":"December","Duration":4.0}]


Anyone know how do I generate a table or how do i tabulate this into a proper table for pdf?
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at
     
    Can you explain how the table should look like in final - That would help in building solution.
     
    Thanks & Regards,
    Nived N
  • JN-27090701-0 Profile Picture
    6 on at
    I wanted to tabulate it into a table with the label of each month vacation transaction, without duplicating user displayed. Thanks.
     
    Applicant November December
    User 1 3 4
    User 2 4 Null/ Empty
     
     
    Regards,
    Jason
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at
     
    Try like this -
     
    1. Use initialize variable action to store the array variable like below
     
    2. Initialize a variable named FinalArr which will storing the final array
     
     
    3. Initialize an object variable like below
     
    4. Use apply to each loop to loop through each elements present in arr1 variable 
     
    Next steps explained will be used in apply to each loop
     
    4.1- use set variable to set objectvariable as empty 
     
    4.2 use compose action to add Applicant property of iterating object to sampleobject like below
     
     
    Expression used : 
    addProperty(variables('sampleobject'),'Applicant',items('Apply_to_each')?['Applicant'])
     
    4.3- use set variable to set the sampleobject variable value
     
    4.4 use apply to each action to loop each user's vacation details like below
    Next 2 steps will be under this loop
    4.4.1- use compose action to add the properties from the vacation into sampleobject like below
    Expression : 
    addProperty(variables('sampleobject'),items('Apply_to_each_2')?['Month'],items('Apply_to_each_2')?['Duration'])
     
    4.4.2: use set variable action to update the sampleobject with output of above compose action.
     
     
    4.5 outside the above loop- use append to array variable action to append the sampleobject data to FinalArr variable
     
     
    Now outside of loop (main loop) - use create html table action by pasisng finalArra variable
     
     
    Its output should look like this 
     
     
    Hope it helps !

    Thanks & Regards,
    Nived N

    Stay connected:
    LinkedIn | YouTube | Blogs

    Was this answer helpful?
    If yes, please mark it as the solution by selecting the checkbox in the discussion thread.
    Your feedback motivates me to keep contributing. Thank you!

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 86 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 55

#3
Ellis Karim Profile Picture

Ellis Karim 53 Super User 2026 Season 1

Last 30 days Overall leaderboard