store email into database collection

I have a colletion called userprofiledata with a primary key field called email (previously title, was renamed) and other custom fields. All custom fields are populated from the UI by linking the input fields to the collection fields. However I am trying to populate the email field in the collection from the members email field. I have a code that retrieves the email from the members collection, however I got into trouble with the code that is supposed to store the email into the userprofiledata collection. Specifically where it should be and how it should be written. Here is what I tried so far, which isn’t working (email column stays empty)
thank you :slight_smile:
michal

Did you place your code within the handler when both page and dataset are ready, something like:

$w.onReady( () => {
$w(“#dataset1”).onReady( () => {
… your code
} );

} );

yes… this is the top part of the code