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 / add an element to arra...
Power Automate
Answered

add an element to array within json

(0) ShareShare
ReportReport
Posted on by 19

Hi, 

I am new to Power Automate however with decent coding skills in typescript ( my background) 

Question: I am struggling to update the array elements within JSON with a set of values in hand.

 

I want to create a final payload for my API call from different sources to make it simple here is my problem statement:

 

1. If  I have a BaseJson Object variable as mentioned below

BaseJson = {
"app": 1,
"names": []
}

 

2.  An array variable of names of type array as below.

[
"cy",
"tt"
]

 

I wish to construct the final object as mentioned below without using string manipulation.

FinalJson = {
"app": 1,
"names": ["cy",
"tt"]
}

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Vimukt ,

     

    I've made a test for your reference:

    My flow:

    vbofengmsft_1-1697174617391.png

    addProperty(removeProperty(variables('BaseJson'),'names'),'names',variables('TheArray'))

    Result:

    vbofengmsft_0-1697174582303.png

     

    Best Regards,
    Bof

     

  • Vimukt Profile Picture
    19 on at

    Thank you @v-bofeng-msft , really appreciate your quick help 👍

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard