wix-crm/wix-users: Contact Record Custom Field Names

I am not sure if this is a feature request or a bug :-).

I have been struggling to understand how to add data to the CRM Custom Fields and thought I would literally follow one of the wix-crm examples.

It turns out that in order to use Custom `Fields you actually have to use the key " customField " in the wix-crm API. This is counter intuitive and not what the documentation states :frowning:

When setting a custom field, use key:value pairs where the key matches the names defined in your site’s Contacts List . You can only set values for custom fields that already exist in the Contacts application.
When I read this it tells me that if I created a custom field called say Credit Card Expiration in my Contact Record then when I want to populate the property Credit Card Expiration then my code should look like this:

let contactRecord = {
      'Credit Card Expiration':value
}

or perhaps

let contactRecord = { 'CreditCardExpiration':value }

or perhaps

let contactRecord = { 'creditCardExpiration':value }

However what I need to do is figure out which custom field I want to populate by going to the Custom Field form in the CRM…


Then I need to count down to the field I want to populate so Credit Card Expiration is position number 3 therefore in wix-crm/wix-users to populate Credit Card Expiration I need to use the key customField3 so my code needs to look like:

let contactRecord = { 'customField3':value }; // Set property for Credit Card Expiration

Can the Wix team please update the documentation to be more clear on this point OR better still provide a way to either add the wix-crm key in the Custom Field dialogue OR provide a simple algorithm such as :

All Custom Field Names will be converted to a camel case key by removing white space, converting all characters to lowercase with the exception of the first letter of all words following whitespace e.g.

      Credit Card Expiration  -> creditCardExpiration
      GDPR Opt Out -> gdprOptOut

Greetings,

Thank you for the clear, descriptive description of your problem and also the solution. I can see why you say it is counter intuitive and I will make sure to raise this issue with our documentation team and reference this board.

Best,
Majd

Thanks Majd.

Hi Steve,

Custom fields functionality works as documented. e.g. in your case:

const contactInfo = {
  firstName: 'x',
  lastName: 'y',
  emails: ['xy@gmail.com'],
  'Credit Card Expiration': new Date(),
  'CreditCard': 12345,
  'UserPhoto': 'www.my-photo.me'
}

or in words:

  • custom fields “keys” should be exactly as written in CRM app (i.e. case sensitive and with whitespaces if required).
  • their javascript type must correlate to the field type as defined in CRM app (e.g. Credit Card Expiration is a date; CreditCard is a number).

Hi Tom:

Thanks I have tried this and it seems to be working.

Can you update the documentation to be more clear on this?

Cheers.

1 Like

hmmm, doesn’t this totally violate PCI compliance? I am sure the databases around here are not PCI compliant for CC info storage. is the CRM module/database PCI compliant for this purpose?

1 Like

Hi Omid,
Thank you for your feedback!
I’ve passed on your concern to Wix’s legal dpt. and you may contact them directly legal@wix.com with any further question.
Unofficially speaking , I can say that it’s the user’s responsibility to use the platform properly and not save his/her users CC details in any way (Section 2.3.4 of our ToU ), either in our storage or in a 3rd party storage (which is also possible with wix code).
Nonetheless, we will introduce notification and docs within several of our products to ensure this is properly mentioned.

Steve - if your example of custom fields usage is not hypothetical, please do not store credit card information as CRM custom field.

Thanks guys. I understand.

I am testing various approaches to this and PCI Compliance and TOU compliance are key to any solution we deploy.

Thanks
Steve

Steve , I can tell you about Zoho Invoice. I love it. It is PCI compliant and lets me save and charge easily in a compliant manner without worry.

My own use case which has worked perfectly over the years. They offer their own capture forms and what not that can easily be embedded. its cheap AF too. I can do manual charges on encrypted and stored CC under client account, I can setup auto-pay subscriptions, etc. MUCH easier to setup and manage than say the heavily-dev-required but robust Stripe backend. I like them too.

A mix of the two can be used with another form provider with success. But a word of warning , even those guys do not allow capture of CC info anywhere outside of their approved payment modules and if they catch you via algorithm doing anything but this, they will INSTANTLY suspend and ban your entire account… hope this helps in providing some options for what you are trying to achieve.

Tom/Wix - PERHAPS Wix should consider introducing PCI compliance to CRM module tbh to keep things under one roof for users who have needs outside of immediate purchases possible within ecommerce or other payment-capable platforms which are still handled by third parties as far as I can tell. OR OR OR perhaps Wix can look into easier option of creating SEAMLESS integrations with popular PCI compliant tools like Zoho Payments, invoice, etc to ensure client data can be correctly synced and safely stored in the right places without risk or challenges to the data processor/collector end user of Wix (account holders).

Introduction of SSL/TLS was a great start. At least things can safely be captured by secured third parties for now, but it creates extra costs and complications in operations, especially for smaller firms and businesses who may be more of an audience target of wix than bigger biz. Just my 2 cents.

I hope you can pass this along to decision makers for considerations.

Thanks
Omid

I have used same code it is working in editor the custom field is filling however on live site that custom field remains empty any help regarding this would be highly appreciated. thanks

I have used same code it is working in editor the custom field is filling however on live site that custom field remains empty any help regarding this would be highly appreciated. thanks

Hey man, have you found any solution for this matter? I’m having to deal with this damn thing as well. No matter what I do, I can’t seem to save any .value to my custom fields in the published website…

The best way to get support is to include your code so that others can help troubleshoot the problem. As this is an old post, I am closing it now. Please create a new post with a description of the problem and your code formatted in a code block. Thanks!