# Custom fields are not recognized by the code

**URL:** <https://forum.wixstudio.com/t/custom-fields-are-not-recognized-by-the-code/69567>\
**Category:** Ask the community\
**Tags:** wix-data, wix-members-area, question, code, wix-studio\
**Created:** [March 12, 2025, 6:51pm UTC](https://forum.wixstudio.com/t/custom-fields-are-not-recognized-by-the-code/69567 "2025-03-12T18:51:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alperoz49](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/alperoz49/32/19881_2.png) [@alperoz49](https://forum.wixstudio.com/u/alperoz49)\
**Post date:** [March 12, 2025, 6:51pm UTC](https://forum.wixstudio.com/t/custom-fields-are-not-recognized-by-the-code/69567/1 "2025-03-12T18:51:42Z")

</div>

**Question:**  
Hi, I am using a code that retrieves data from member info specifically from a custom field  
“wallet”

however it only recognize default fields like first name, last name etc… and when I replace my data - that is in the custom field - with last name it works (lastName)

```javascript
import wixData from 'wix-data';
import wixUsers from 'wix-users';

$w.onReady(async function () {
  const user = wixUsers.currentUser;
  console.log("User logged in status:", user.loggedIn);
  if (user.loggedIn) {
    try {
      const memberData = await wixData.get("Members/PrivateMembersData", user.id);
      console.log("Full member data:", memberData);
      console.log("Wallet:", memberData.contactDetails?.customFields?.wallet);
    } catch (err) {
      console.error("Error fetching member data:", err);
    }
  } else {
    console.log("No user logged in");
  }
});

```

I use this code to see this output

```javascript
User logged in status: true

Full member data:

{...}

jsonTableCopy JSON

name:

"X X"

lastLogin:

"Wed Mar 12 2025 21:16:28 GMT+0300 (GMT+03:00)"

loginEmail:

"x@gmail.com"

_id:

"ID"

_createdDate:

"Thu Apr 04 2024 00:59:24 GMT+0300 (GMT+03:00)"

_updatedDate:

"Thu Apr 04 2024 00:59:24 GMT+0300 (GMT+03:00)"

slug:

"X"

phones:

[...]

lastName:

"X"

firstName:

"alper"

mainPhone:

"null"

language:

"en"

status:

"ACTIVE"

picture:

"https://l"

nickname:

"x x "
**Wallet: undefined**

```

as you see wallet field is undefined.  
but if I use lastName as wallet its there and codes are working with that field.

Can you tell me how can I create a custom field that works like default fields?

**Product:**  
Wix Studio

**What are you trying to achieve:**

**What have you already tried:**

**Additional information:**

---

<div class="post-metadata">

**Author:** ![onemoretime](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/onemoretime/32/104023_2.png) [@onemoretime](https://forum.wixstudio.com/u/onemoretime)\
**Post date:** [March 13, 2025, 4:19pm UTC](https://forum.wixstudio.com/t/custom-fields-are-not-recognized-by-the-code/69567/2 "2025-03-13T16:19:28Z")

</div>

Hi, @alperoz49 !!

Personally, I think it’s better not to add custom fields to the `Members/PrivateMembersData` collection. 🤔 Instead, you could create a separate collection, define a `wallet` field there, and link it to the `Members/PrivateMembersData` data using a reference field. 😁

---

<div class="post-metadata">

**Author:** ![noahlovell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/noahlovell/32/118920_2.png) [@noahlovell](https://forum.wixstudio.com/u/noahlovell)\
**Post date:** [March 13, 2025, 6:50pm UTC](https://forum.wixstudio.com/t/custom-fields-are-not-recognized-by-the-code/69567/3 "2025-03-13T18:50:31Z")

</div>

Also worth noting that `wix-users` is deprecated, so worth transitioning to `wix-members-frontend` or `wix-members-backend` depending on the use case.

Also worth noting we’re beginning to transition to SDK (Velo will continue to function, so no need to move if you don’t want to) - [Get Current Member | SDK](https://dev.wix.com/docs/sdk/backend-modules/members/members/get-current-member) - for the most part, the code remains the same, but imports and a few smaller syntaxes here and there would change.
