database collects member name as field when filling out form

Hi,

I’d like to have users fill out information on a form field (through a radio button) that links to a database to collect the information. If users are members and signed in, I’d like that to autopopulate into my database, either as a column or as the ID. Is that possible?

I’m new at coding, so I wouldn’t be able to tell you exactly what to enter to do what you want to do, but it does seem to be possible based on the API:
https://www.wix.com/code/reference/wix-users.User.html

Here is some code I found that you might use:

Get the current user’s information

import wixUsers from ‘wix-users’;

// …

let user = wixUsers.currentUser;

let userId = user.id; // “r5cme-6fem-485j-djre-4844c49”
let isLoggedIn = user.loggedIn; // true
let userRole = user.role; // “Member”

user.getEmail()
.then( (email) => {
let userEmail = email; // “user@something.com
} );

I hope this helps!

Hi,
Check out this tutorial:

Roi.

Super helpful. Thanks!