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?
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
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
}
Hi @Kgpavan, you can use the expression setProperty.