Skip to main content

Notifications

Community site session details

Community site session details

Session Id : G6Fom/Q+uyl9pfawcskPbE
Power Automate - Building Flows
Answered

Append a string to the last element of the array

Like (0) ShareShare
ReportReport
Posted on 14 Sep 2021 21:44:01 by 404

Hello.

I have the array

[
 {
 "User1": "john@microsoft.com",
 "User2": "bill@microsoft.com"
 },
 {
 "User1": "kate@microsoft.com",
 "User2": "bob@microsoft.com"
 },
 {
 "User1": "sarah@microsoft.com",
 "User2": "jack@microsoft.com"
 }
]

And a string: julia@microsoft.com

I need to add it to the last element of the array:

[
 {
 "User1": "john@microsoft.com",
 "User2": "bill@microsoft.com"
 },
 {
 "User1": "kate@microsoft.com",
 "User2": "bob@microsoft.com"
 },
 {
 "User1": "sarah@microsoft.com",
 "User2": "jack@microsoft.com"
 "User3": "julia@microsoft.com" 
 }
]

How to do that?

  • Verified answer
    PrasadAthalye Profile Picture
    4,795 on 14 Sep 2021 at 21:59:09
    Re: Append a string to the last element of the array

    There isnt any direct function for this. Please see following steps.

    • Declare InputArray variable of type array and initialize with original data.
    • Declare Another array variable called FinalArray and Set value as first and second array element from InputArray.
    • Now use Append to Array variable and create third element with new values and append to Final Array.
    • Finally use Compose to see the output.

    PrasadAthalye_0-1631656739160.png

     

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 318 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 271 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 259

Overall leaderboard
Loading started
Loading complete