I’m trying to add code to a Member Profile page so that additional custom fields from the Contact data can be shown. I’ve added fields to the Profile page that need to be populated.
It seems the Member data has a contactId that I could use to lookup the data. However, how do you get this field while you’re on the page? The code below is a start where I can access the iframe, but the Member fields don’t seem to be accessible. How can that be done?
// For full API documentation, including code examples, visit https://wix.to/94BuAAs
import wixCrm from 'wix-crm-backend'
$w.onReady(function () {
// Get the contactId from the member
// Lookup the contact with that id
// Set the university field
$w('#memberInfo1') <<
getContactInfo(contactId);
});
export function getContactInfo(contactId) {
return wixCrm.getContactById(contactId);
}
Please note the difference between Wix CRM and Wix Users. What’s the difference between wix-crm and wix-users? The CRM API contains functionality for working with your site’s contacts. The Users API contains functionality for working with users who are logged-in members. Note that all members are also contacts, but contacts are not necessarily members.
Also, note that the Profile page in the Wix Members app is the same page as the Community Page URL that is shown on the My Account page.
This Profile page is what any other currently logged in site member can see, it is not restricted to just that specific site member as like the rest of the Wix Member app pages.
Thanks for the info. If I build my own members profile with custom fields, how will the sign up work? Currently I have that setup and it created a PrivateMemberCollection that I can’t add fields to. Also, if I go the former route how can I have it that contacts and members get populated?