I am using a third party API to manage users on my wix site. I would like to save the ID of the user on the other server to my wix user profile. I see that this is possible (in theory) with the customFields object of the wix user profile.
see: updateMember - Velo API Reference - Wix.com
I am unable to push any value into the customFields object. I have tried every way imaginable and none of them are working. Here is the current block of code that SHOULD work but does not…
note: updatedInfo is equal to the current user information that is fetched with getCurrentMember
if(!updatedInfo.contactDetails.customFields.OtherDB_ID || updatedInfo.contactDetails.customFields.OtherDB_ID !== OtherDB.ID.split(" ")[0]) {
updatedInfo.contactDetails.customFields = {"OtherDB_ID" : OtherDB.ID.split(" ")[0]}
}
note: OtherDB.ID is a string with 3 blank spaces after it so the .split()[0] just removes the trailing spaces. (I.E. "11111 ")
I have already verified that OtherDB.ID is passed and referenced correctly.
After assigning the new values to the updatedInfo object I am updating the wix user with the following line:
return members.updateMember(wixUser._id, updatedInfo).then(() => {return memberInfo})
It is also worth noting that every other field that I set (name, address info, custom badges, etc.) ALL WORK. It is JUST the custom Fields that are refusing to work as expected. I am not sure what else I can try at this point.