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

Add multiple properties to array object dynamically based on object property

(0) ShareShare
ReportReport
Posted on by 1,115

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:
I have the same question (0)
  • Verified answer
    rameshmukka Profile Picture
    1,115 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
    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

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard