Submitted copied input fields

I have an input where the user can select to copy (with a button) his/her information from the subscription data. When the form is submitted the information is not being populated in the submission form. However if the user inputs the fields manually the fields in the form are being populated.

Any help out there please?

Does your form use a Dataset to connect to the Database Collection? You probably need to use the dataset function setFieldValues() , or, for only one field, setFieldFieldValue() .

Yes it does. Can you please help me on how to continue code as am still new new to coding

You will need something like this:

export function button1_click(event) {
    $w("#input5").value = $w("#input1").value;
    $w("#input6").value = $w("#input2").value;
    $w("#input7").value = $w("#input3").value;
    $w("#input8").value = $w("#input4").value;
    $w("#myDataset").setFieldValues( {
       "field5":  $w("#input1").value,
       "field6":  $w("#input2").value,
       "field7":  $w("#input3").value,
       "field8":  $w("#input4").value,
    } );
}

You will need to change #myDataset to the name of your dataset.
You will also need to change the field names (field5, field6, etc) to whatever field names you are using in your Dataset collection.

The documentation on setFieldValues(), explains how to use and what’s needed.

Yes it worked perfectly. Thanks a million