Getting data from dataset1 to save in dataset2??

Hi,

I would like my site to be able to pre-fill information that the “Members” databate when that member creates a post. In particular, their name and email address, so the post cannot be submitted anonymously.

The following code appears to works on screen. The data from the membership database is is displayed in #Member1, 2, etc… and upon pressing the WriteButton1, shows up in the #Cont1,2, etc as hoped, which is connected to the form submission dataset.

However, when submitting the form, none of the data is saved to the dataset. Can you please help?

export function WriteButton1_click(event) {
$w(‘#VidButton1’).disable();
$w(‘#PicButton1’).disable();
$w(‘#buttonBeginWrite’).expand(“”);
$w(“#dataset1”).onReady(()=>{
let itemObj1 = $w(“#Member1”).value;
let itemObj2 = $w(“#Member2”).value;
let itemObj3 = $w(“#Member3”).value;
let itemObj4 = $w(“#Member4”).value;
{
$w(“#Cont1”).value = itemObj1;
$w(“#Cont2”).value = itemObj2;
$w(“#Cont3”).value = itemObj3;
$w(“#Cont4”).value = itemObj4;
$w(“#Cont5”).value = “Yes”;
$w(“#Cont6”).value = “”;
$w(“#Cont7”).value = “”
}
});
}

add this to the end of your code

    $w('# [dataset1](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.ataset1) ').setFieldValue('fieldKey1ChangeMePlease',   itemObj1;  
    $w('# [dataset1](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.ataset1) ').setFieldValue('fieldKey2ChangeMePlease',  itemObj2;  
    $w('# [dataset1](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.ataset1) ').setFieldValue('fieldKey3ChangeMePlease',  itemObj3;  
    $w('# [dataset1](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.ataset1) ').setFieldValue('fieldKey4ChangeMePlease',  itemObj4;  
    $w('# [dataset1](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.ataset1) ').save(); 

the code is suppose to look like this

but wix platform is posting this, such a buggy platform…

Brilliant. Thanks for your help!