Hi there, I’m stuck at the end of this problem:
I have a custom form that contains several Input fields.
I created a Collection dataset for this Form.
Then, I mapped the Elements and the dataset.
Everything is running as I expected. Easy.
Upgrade
I am interested in enriching this dataset with “CurrentMember” data (member._id) from wix-members source.
So I modified the publicly available script as follows:
import { currentMember } from ‘wix-members’ ;
$w . onReady ( function () {
currentMember . getMember ()
. then (( member ) => {
$w ( '#MemberName' ). value = ` ${ member.contactDetails.lastName } ${ member.contactDetails.firstName } ` ;
$w ( '#MemberEmail' ). value = member.loginEmail ;
**return** member ;
})
. **catch** (( error ) => {
console . error ( error );
});
});
The result:
The data appears in the corresponding Element IDs.
Great.
The Problem:
The data is transferred to the corresponding Elements. As expected.
I can see it visually (preview) and subsequently in Logs (I log the content of Elements).
However, after submitting the Form, the data from these Elements are not transferred to the Collection dataset even if they are mapped to the corresponding dataset.
After checking in Collection, these records are empty.
Can you advise me on what I am doing wrong?
PS: The Elements will be hidden; the user does not need to see them. However, I need them in datasets.
Thx