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 / Add multiple propertie...
Power Automate
Answered

Add multiple properties to array object dynamically based on object property

(0) ShareShare
ReportReport
Posted on by 1,133

I have a requirement to add multiple properties to an array object based on one of the key value of the same array object. 

 

My Input array is below

{
 "body": [
	{
 "Base64Parts": ["Rick"],
 "NoofParts": 1
 },
 {
 "Base64Parts": ["John","Mark","Roy"],
 "NoofParts": 3
 },
	 {
 "Base64Parts": ["Adam","Steve"],
 "NoofParts": 2
 }
 ]
}

Now based on the maximum value of the "NoofParts" key in the object, I would like to add the same number of properties to each object in the array. Here is my output object.

 

{
 "body": [
	{
 "Base64Parts": ["Rick"],
 "NoofParts": 1,
	 "Part1": "Rick",
	 "Part2": "",
	 "Part3": "",
 },
 {
 "Base64Parts": ["John","Mark","Roy"],
 "NoofParts": 3,
	 "Part1": "John",
	 "Part2": "Mark",
	 "Part3": "Roy",
 },
	 {
 "Base64Parts": ["Adam","Steve"],
 "NoofParts": 2,
	 "Part1": "Adam",
	 "Part2": "Steve",
	 "Part3": "",
 }
 ]
}

 

Please advise. I am looking out for ways without using nested apply to each.

 

Thanks and Regards,

Ramesh Mukka

Categories:
  • Verified answer
    rameshmukka Profile Picture
    1,133 on at

    I was able to get it done with the help of parent-child flows if not Nested Apply to each. It is reasonably fast for as far as 1000 rows I ran. Here are flow snapshots if that can help someone.

     

    Parent Flow

    RameshMukka_0-1705231476649.png

     

    Child Flow

    RameshMukka_1-1705231510824.png

     

    Thanks and Regards,

    Ramesh Mukka

     

     

     

     

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @RameshMukka,

    Thanks for your sharing.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 317 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 247

#3
Henil Profile Picture

Henil 117

Last 30 days Overall leaderboard