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

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard