Another try…
$w.onReady(function() {
let fName, title, ID;
$w('#dataset1').onReady(()=> {
fName = $w("#dataset1").getCurrentItem().fname;
title = $w("#dataset1").getCurrentItem().title;
ID = $w("#dataset1").getCurrentItem()._id;
$w("#input1").value = fName;
$w('#dataset2').onReady(()=> {
$w('#dataset2').setFieldValue('fname', $w('#input1').value);
$w('#dataset2').save();
});
});
$w("#dataset2").onAfterSave(()=> {
console.log("After save ---> "+fName):
$w("#input1").value = fName;
console.log("Title: ", title);
console.log("ID: ", ID);
});
});
And you still didn’t say anything about → if you are using a custom form, or a Wix-Form!