Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Process Mining
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:
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Replace Json property

    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

  • Kgpavan Profile Picture
    3 on at
    Re: Replace Json property

    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
    Re: Replace Json property

    Hi @Kgpavan, you can use the expression setProperty.

     

    setProperty(object: object, property: string, value: any)
     
    setProperty(variables('yourarray'), 'someproperty', 'svalue2')

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

🌸 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…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Process Mining

Overall leaderboard