How to access custom Contact field in code?

My users have “levels” that they are asked to enter into the sign-up form. If a user signs up as a Level 1 student, he is shown level 1 questions on a test. My site: https://www.psquareinternational.com/ has these pages currently hidden.

The Contacts have their levels stored in the “Alevel” column of the Contacts List. How do I access the “Alevel” variable through my page code?

If that is not possible at all, how else are we supposed to assign levels to students that we can access through our code?

Similar unresolved question: https://www.wix.com/corvid/forum/community-discussion/api-access-to-contacts-data

Hello Bhavika Khare,

You can get CONTACT-DATA from the CRM-BACK-END…like…

import wixCrmBackend from 'wix-crm-backend';
2
3export function myBackendFunction(contactId) {
4  return wixCrmBackend.getContactById(contactId);
5}

How will I get the contactID of the current user? Is it the same as the userID of the current user, which I get from wixUsers.currentUser.id?

@bhavikakhare

There are just 2-options:

  1. ._id
  2. ._owner

Try it out.