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 Automate
Unanswered

Replace Json property

(0) ShareShare
ReportReport
Posted on by 3

Hi I am trying to get a JSON from some source and once I get it, I want to replace some property.

Example JSON I got

{

"Ida":"11",

"Name":"MyName",

"Type":"SomeType"

"InnerValue": {

   "Id":"23",

   "someproperty":"svalue",

   "anotherproperty":"avalue",

   "code":null,

   "access":false

   }

}

I want to replace the entire InnerValue property with my different values like

"InnerValue": {

   "Id":"28",

   "someproperty":"svalue2",

   "anotherproperty":"avalue2",

   "code":null,

   "access":true

   }

How can we do that?

Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Kgpavan, you can use the expression setProperty.

     

    setProperty(object: object, property: string, value: any)
     
    setProperty(variables('yourarray'), 'someproperty', 'svalue2')
  • Kgpavan Profile Picture
    3 on at

    Thank you DamoBird365.

    Can we do setProperty(variables('myjsonarray'), 'InnerValue', 'InnerValue2')?

    where myjsonarray is the above entire array and InnerValue2 is 

    {

       "Id":"28",

       "someproperty":"svalue2",

       "anotherproperty":"avalue2",

       "code":null,

       "access":true

       }

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Kgpavan 

     

    I believe you can.  There is an expression createArray() which allows you to define the new InnerValue2.  I have to admit I am not a pro on this but I have given it a go in the past.  Reza Dorrani does a demo of it in use here https://rezadorrani.com/index.php/2021/02/14/power-automate-flow-expressions/ and has a github with pre-built examples if you want to play with it.  

     

    Damien

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard