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 / Append a string to the...
Power Automate
Answered

Append a string to the last element of the array

(0) ShareShare
ReportReport
Posted on 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?

Categories:
I have the same question (0)
  • Verified answer
    PrasadAthalye Profile Picture
    on at

    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

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard