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 / How to update Array Ob...
Power Automate
Unanswered

How to update Array Object properties in Power Automate

(0) ShareShare
ReportReport
Posted on by 128

Hi,

 

I've an Object Array structure like following one.

 

 

 

[
 {
 "Approvers": [
 {
 "DisplayName": "Person 1",
 "Email": "Person 1 email",
 "Status": "Not Started"
 },
 {
 "DisplayName": "Person 2 email",
 "Email": "Person 2 email",
 "Status": "Not Started"
 }
 ],
 "Status": "Not Started"
 },
 {
 "Approvers": [
 {
 "DisplayName": "Person 3 email",
 "Email": "Person 3 email",
 "Status": "Not Started"
 }
 ],
 "Status": "Not Started"
 }
]

 

 

 

 

I would like to update individual properties of Array Object and keep the entire updated object. for example, I just want to update the Person 1 email in first Approvers. I tried with setProperty function but that doesn't seem to work with Arrays.

 

Any suggestions???

 

Appreciate your time. Thanks

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,270 Most Valuable Professional on at

    There is no easy way to update a value inside an array in Power Automate.  Essentially you'll need to read and process the array to create a new array with the substitute values.  In your case that is even more difficult because you have embedded arrays inside the outer array.  You can handle updating an individual array using the Data Operations Select statement. Simply map each of the columns and then supply the values for the new entries.  You can then use an IF statement in the column you want to change to insert the new value.

  • NeonThunder Profile Picture
    76 on at

    Any updates to what the code will look like?

  • Pstork1 Profile Picture
    69,270 Most Valuable Professional on at

    Please post this as a new question and provide a detailed example.  You'll get more responses and others will be able to find the answer more easily later.  Without knowing what your data looks like there is no way to provide what the code would look like.

  • NaserTahiri Profile Picture
    2 on at

    using Power Automate's Compose action with the union and if expressions to update the Email field for "Person 1":

     

    union(
     variables('yourArrayVariable'),
     [
     {
     'Approvers': [
     if(equals(items('Your_Approvers_Loop')?['DisplayName'], 'Person 1'),
     {
     'DisplayName': 'Person 1',
     'Email': 'New Person 1 Email',
     'Status': items('Your_Approvers_Loop')?['Status']
     },
     items('Your_Approvers_Loop')
     )
     ],
     'Status': items('Your_Main_Loop')?['Status']
     }
     ]
    )

     

     

     

    In this example, yourArrayVariable should be the original array, and 'Your_Approvers_Loop' and 'Your_Main_Loop' should be your current items in the respective Apply to each loops (you can get these with the Current item from the dynamic content panel).

    Let's break this down:

    • union() is merging your existing array with the new array we're creating inside of it.
    • Inside the if(), we check if the DisplayName is "Person 1". If it is, we update the Email; if not, we keep it as is (items('Your_Approvers_Loop')).

     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard