Hello! firstly I would like to thank you for taking the time to answer… I can confirm however that the CRM Api doesn’t update any of the contacts stored in the Wix contact list. I am talking about contacts (not site members). And they are not listed as members, they are just contacts.
I Have a basic form with name, lastname and email. this is the code that I am using. The variables are connected to input fields, and everything runs with the button’s onclick .
export function signUpButton_click(event) {
let firstName = $w(“#inputName”).value,
let lastName = $w(“#inputLastName”).value,
let email = $w(“#inputEmail”).value
wixCRM.createContact( {
“firstName”: firstName,
“lastName”: lastName,
“emails”: [email]
} )
.then( (contactId) => {
console.log(“contact created”)
} );
}
As stated in the reference :
Calling createContact() performs one of the following. (The contact information specified in the contactInfo parameter matches an existing contact if it contains an email address or phone number from an existing contact.)
-
If there is no matching existing contact, a new contact is created using the information specified using the contactInfo parameter.
-
If there is a matching existing contact, it is updated with the information specified using the contactInfo parameter. Any existing contact information that is not explicity overriden in the contactInfo parameter retains its existing value.
Registering the contact for the first time works perfectly, however when the contact is already on the contact list (which would be the option #2 of the API) nothing happens, the contact stays the same. And even when I delete the contact from the contacts list, and repeat the registration using the form, It appears with the old name again… which is a very weird behaviour.
I thank you for your help and maybe you have an idea what is happening here… I also read some posts here in the forum of people having exactly the same problem.
Cheers
Fernando