User input not visible in collection

I have a submission form that connects to a collection (Submissions). The submission form has two user inputs (Username and Phone). I use a code to auto fill both user inputs from the Members/PrivateMembersData collection. When you click the button it submits to the collection but the words are not visible in collection. I know it submits bc I also use a code that does not allow duplicate usernames/phone numbers to be submitted to the collection, so when I try a second time the submit fails (like it should).

Question: Why do both autofilled user inputs submit to my collection but the words are not shown? How can I fix this? I believe i had it working some time ago but for some reason it no longer does.

What are you using on your page to capture this user input and what code are you using, is it a sign up form or create contact form?

A little bit more info can help us from trying to guess the reason why something isn’t working.

Plus what gets filled into the dataset fields when you enter something into the user input form, is it the same as the user input, should be but worth checking.

Also, check your field names within the ProvateMembersData as phone can be mainPhone or phones as their field keys.

The same with the name, are you using firstName or lastName or name (which is the full name by using a combination of both first and last inputs).

https://support.wix.com/en/article/corvid-wix-members-privatemembersdata-collection-fields

The auto fill code is working correctly so when I click on the page it shows both my username and phone number in the correct user inputs.

Both inputs are required to be filled for the form to submit. So when I click submit and it is successful, it recognizes that the user input has content but that content is not shown within my collection, just blank squares.
If i add another user input and type something in it then submit all three, the username and phone, which i pulled from the members data, does not appear in the collection but the other input that i typed in does.

The dataset permissions are: admin, sit member, admin, admin - write only

The user inputs are connected to the database from their settings (the four discs icon) not from code

Here is the code i use to pull the members nickname

$w.onReady( function () {
wixData.query(“Members/PrivateMembersData”)
.eq(“_id”, wixUsers.currentUser.id)
.find()
.then( (results) => {
$w(‘#input1’).value = results.items[0].nickname;
});
} );

Thank you for helping

Also i will add that if i manually type into any of the user inputs, they work fine. It is just the problem of when the user input is automatically filled.

can anyone help with this?

For anyone who has this same problem this code worked for me:

export function button1_click(event,$w) {
$w(‘#dataset3’).setFieldValue(‘username’,$w(‘#input1’).value);
$w(‘#dataset3’).save();
}

Open the properties panel of your submit button and add onclick event, just copying the code will not work