Skip to Content
Nov 08, 2021 at 12:45 PM

How to prevent json model cross reference



I have created one json model A which has same structure as another global json model B.

For ex Json Model B =

{ "test" : [

"tester" :{}

"tester" : {}]}

Json Model A =

{"tester" : {}}

I have written a logic that when I have some value on my dialog Input screen then I collect values in model A and then after validation push A to B, which add another tester entry to global model B. It all looks good when first tester is added.

Problem comes when dialog is open 2nd time to add another tester, when new values assigned to model A, model B existing values also gets updated as model A is cross referencing to model B after 1st assignment. Can someone please advice how can I prevent this referencing so I can use model A and B as local and global parameters. I need to add multiple values to model B by appending values collected in model A.