Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

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

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 79

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 70 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard
Loading started