I want that a user can submit information to a database, however, I also want to register the adress of the user in the new database. I appreciate any help!
You can simply add custom fields into your contacts and save them when you register the user as a member.
https://support.wix.com/en/article/adding-custom-fields-to-contacts
https://support.wix.com/en/article/syncing-your-form-with-your-contact-list-fields
Something like this for your signup lightbox:
import wixUsers from 'wix-users';
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#registerButton").onClick( (event) => {
let email = $w("#email").value;
let password = $w("#password").value;
let first = $w("#firstName").value;
let last = $w("#lastName").value;
wixUsers.register(email, password, {
contactInfo: {
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value,
//add all your custom contact fields here
}
} )
.then( (result) => {
let resultStatus = result.status;
wixWindow.lightbox.close();
wixLocation.to("/sign-in-status"); //Change the URL ending to whatever page you want to send the user to after they log in.
} );
} );
});
This works perfectly and closes automatically after registering details before moving user on to my sign in status page, then both names will be saved in contacts and once site member is approved the member details will be added to ‘members’ database.
For more info see the register api reference.
https://www.wix.com/corvid/reference/wix-users.html#register
Or can either do something like this and create your own members profile page where you can let members add anything that you want them to include.
You won’t be able to use the Wix Members collection as that is read only for the site member author and you can’t add additional fields into that dataset.