# \[RESOLVED\] customFields of a currentMember

**URL:** <https://forum.wixstudio.com/t/resolved-customfields-of-a-currentmember/11453>\
**Category:** Ask the community\
**Tags:** wix-members-area, question, code\
**Created:** [November 3, 2022, 9:02pm UTC](https://forum.wixstudio.com/t/resolved-customfields-of-a-currentmember/11453 "2022-11-03T21:02:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![production44747](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@production44747](https://forum.wixstudio.com/u/production44747)\
**Post date:** [November 3, 2022, 9:02pm UTC](https://forum.wixstudio.com/t/resolved-customfields-of-a-currentmember/11453/1 "2022-11-03T21:02:17Z")

</div>

Hello,  
I want to retrieve the value of a custom field from a contact. The key to my field is “your-documents”.

I tried using the documentation available here : [Get Member | Velo](https://www.wix.com/velo/reference/wix-members-backend/currentmember/getmember)

But I can’t get the value.  
Here are the codes I tested

import { currentMember } from ‘wix-members’;

$w.onReady(function () {

```
currentMember.getMember() 
  .then((member) => { 

  const fullName = `${member.contactDetails.firstName} ${member.contactDetails.lastName}`; 
  const Test1 = `${member.contactDetails.customFields}`; 
  const Test2 = `${member.contactDetails.customFields.custom.vos-documents}`; 
  const Test3 = Test1["custom.vos-documents"]; 
  
  console.log("fullName : ", fullName); // fullName : Nicolas Suteau (OK) 
  console.log("Test1 : ", JSON.stringify(Test1, null, 4)); // Test1 : "[object Object]" 
  console.log("Test2 : ", Test2); // Error : TypeError: Cannot read properties of undefined (reading 'vos') 
  console.log("Test3 : ", Test3); // Test3 : undefined 
}) 

```

});

---

<div class="post-metadata">

**Author:** ![production44747](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@production44747](https://forum.wixstudio.com/u/production44747)\
**Post date:** [November 8, 2022, 2:25pm UTC](https://forum.wixstudio.com/t/resolved-customfields-of-a-currentmember/11453/2 "2022-11-08T14:25:59Z")

</div>

L’équipe de Wix m’a donné la solution :

Voici comment retrouver la valeur :

const Test1 = member.contactDetails.customFields[‘custom.vos-documents’].value

---

<div class="post-metadata">

**Author:** ![production44747](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@production44747](https://forum.wixstudio.com/u/production44747)\
**Post date:** [November 8, 2022, 2:56pm UTC](https://forum.wixstudio.com/t/resolved-customfields-of-a-currentmember/11453/3 "2022-11-08T14:56:02Z")

</div>

console.log(member) : to find the KEY of your custom field.

---

<div class="post-metadata">

**Author:** ![vinnysantini](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/vinnysantini/32/86729_2.png) [@vinnysantini](https://forum.wixstudio.com/u/vinnysantini)\
**Post date:** [January 7, 2024, 4:13pm UTC](https://forum.wixstudio.com/t/resolved-customfields-of-a-currentmember/11453/4 "2024-01-07T16:13:02Z")

</div>

Thank you so much for publishing this @production44747, I’ve spent multiple hours trying to find how to use the custom field. The Wix Velo doc does not mention how to use it. For anyone who might be having issues, here’s how I’ve done it.

So first, I created a custom field in the member settings in the Wix admin panel. I first created the field called _Preferences notifications_.

I then changed its name to _Courriels_. The thing is, when I was trying to use the custom field in the code panel, _courriels_ was not working. That is because the key of the field was still the first name I had given it, which was Preferences notifications.

So by using the console.log(member), I was able to find this in the developer console

 ![image](https://us1.discourse-cdn.com/wix/original/3X/a/7/a79be3631d92f12aa610635ebee075ea74a5f4e3.png)

So, to get the value of that custom field, I had to do it this way

```javascript
import { currentMember } from 'wix-members-frontend';
$w.onReady(function () {
  currentMember.getMember()
    .then((member) => {
      console.log(member)
      const courriels = member.contactDetails.customFields['custom.preferences-notifications'].value;
})

```

Hope that can help anyone in the future who wants to use custom fields for members on their Wix website.

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [January 8, 2024, 12:42pm UTC](https://forum.wixstudio.com/t/resolved-customfields-of-a-currentmember/11453/5 "2024-01-08T12:42:40Z")

</div>

Like i already told you → **CONSOLE = YOUR BEST FRIEND** 🥳
