Export function not collecting field value of auto fill code

Is the Submit button connected to the Dataset? If so, then the Submit_click() event handler won’t be run.

What you need is to set the Dataset field value at the same time that you set the input field. Make sure you disconnect the Submit from the Submit_click() function. To clean up, you should also delete the Submit_click() function.

$w.onReady(function () {
    $w('#dataset2').onReady(() => {
        $w("#input1").value = $w("#dataset2").getCurrentItem().fname;
        $w('#dataset1').setFieldValue('fname',$w('#input1').value);
    })
})