shivkumar
(Shiv Kumar27bf02)
1
Hi Team,
I have two Json File , One for DEV and One for PROD,
Basically i am trying to append “XYZ” from DEV JSON file to PROD file,
Could you please help me here , Attached is the JSON files
When ever new App code added i want to perform the same, so both file must be same
FileProd.txt (90 Bytes)
FileDev.txt (171 Bytes)
shivkumar
(Shiv Kumar27bf02)
3
can u give me a small solution
I tired diff ways, but now i am doing this way also
shivkumar
(Shiv Kumar27bf02)
5
What is json object argument type ?

ppr
(Peter Preuss)
7
Maybe append can be understood as a merge:
1 Like
shivkumar
(Shiv Kumar27bf02)
8
Its updating whole file in need to append that key only “XYZ”
Prod can have more, Dev can be less
shivkumar
(Shiv Kumar27bf02)
9
Firstly Thanks for the help
1 Like
@shivkumar
Instead of Write text use Append line text activity to append
Check the below once
shivkumar
(Shiv Kumar27bf02)
11
No this is not working , It will just append and break the JSON schema
ProdJsonObj.Merge(devJsonObj(“XYZ”)) is working but one problem is here
It is not merging in similar way

ppr
(Peter Preuss)
12
Illustrating above

with Details:
Before:

After:

And we can also fine tune the merging by adapting the MergeSettings
ppr
(Peter Preuss)
14
When it is about a Level1 merge and we want only add missing L1 Properties
In the mind that we can construct JOBjects from JProperty Collections:

We can do:
And get the merged JSON by:
So the origin ABC Appcode from Prod is kept and not overwritten by Dev
If it is needed different let us know and we can check for adaptions
1 Like
shivkumar
(Shiv Kumar27bf02)
15
its updating the whole code,
FileProd.txt (182 Bytes)
FileDev.txt (372 Bytes)
I want to update only the XYZ updating file are attached for more clarification
ppr
(Peter Preuss)
16
share expected output from the above inputs
as we mentioned:
shivkumar
(Shiv Kumar27bf02)
17
Using code i will check for the key “XYZ” that will be update only
SO no matter how many key on DEV file what i am looking that is going to be update
shivkumar
(Shiv Kumar27bf02)
18
Did you motioned the solution ?
@shivkumar
Newtonsoft.Json.JsonConvert.SerializeObject(ProdJsonObj, Newtonsoft.Json.Formatting.Indented)
Hope it helps!!
shivkumar
(Shiv Kumar27bf02)
20
assign activity code please
postwick
(Paul Ostwick)
21
Just open them in Notepad and make the edits. They’re just text files.