var nNC = Mysubform.instanceManager.count;
var myNC_Ref = [];
for (var i = 0; i < nNC; i++){
var sSubform = "Mysubform["+i+"]";
myNC_Ref[i] = xfa.resolveNode(sSubform).Mydata.rawValue;
}
xfa.host.importData();
var nNewNC = Mysubform.instanceManager.count;
var nTotalNC = nNC + nNewNC;
Mysubform.instanceManager.setInstances(nTotalNC);
for (var i=0; i<nNC; i++){
var j = nNewNC + i;
var sSubform = "Mysubform["+j+"]";
xfa.resolveNode(sSubform).Mydata.rawValue = myNC_Ref[i];
}
xfa.form.recalculate(1);