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 change an Eleme...
Power Automate
Answered

How to change an Element of an array in power automate

(0) ShareShare
ReportReport
Posted on by 8

so I have this array called "groupedItems" which basically looks like this:

 

 

[
 {
 "bestelltbei": "Arzt",
 "Email": "test@testmail.com",
 "Items": [
 {
 "Patient": "Testpatient1",
 "Bestellung": "1 Rollstuhl"
 }
 ]
 }
]

 

with every new order this array should update to something like this:

 

[
 {
 "bestelltbei": "Arzt",
 "Email": "test@testmail.com",
 "Items": [
 {
 "Patient": "Testpatient1",
 "Bestellung": "1 Rollstuhl"
 },
 {
 "Patient": "Testpatient2",
 "Bestellung": "1 Verband"
 },
 ]
 }
]

 

 

I can't seem to find the right operation, tried it with union etc. 

 

union(variables('groupedItems')[variables('currentIndex')]['Items'],variables('secondarray'))

 

but I cannot "navigate" to the inner "Items"-array.

"secondarray" looks like this: 

 

{
 "Patient": "@{items('Apply_to_each')?['Title']}",
 "Bestellung": "@{items('Apply_to_each')?['Menge']} @{items('Apply_to_each')?['Medikament']}"
}

 

 

Please help, sitting on this for days. Thanks in advance...

Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

     @zonkgilbert Do you mean you have two arrays like this 

     

    [
     {
     "bestelltbei": "Arzt",
     "Email": "test@testmail.com",
     "Items": [
     "Patient": "Testpatient2",
     "Bestellung": "1 Verband"
     ]
     }
    ][
     {
     "bestelltbei": "Arzt",
     "Email": "test@testmail.com",
     "Items": [
     {
     "Patient": "Testpatient1",
     "Bestellung": "1 Rollstuhl"
     }
     ]
     }
    ] 

    and you want to combine them together as

     

    [
     {
     "bestelltbei": "Arzt",
     "Email": "test@testmail.com",
     "Items": [
     {
     "Patient": "Testpatient1",
     "Bestellung": "1 Rollstuhl"
     },
     {
     "Patient": "Testpatient2",
     "Bestellung": "1 Verband"
     },
     ]
     }
    ]

    @ 

     

  • zonkgilbert Profile Picture
    8 on at

    @SudeepGhatakNZ Exactly!

  • Verified answer
    SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Please refer the attached flow.

     

  • zonkgilbert Profile Picture
    8 on at

    worked as intended.

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 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard