Transfer member portal info automatically into CMS when uploading documents (Wix Editor)

In Wix Editor, I have clients set up as site members with a client portal where they are expected to upload documents regularly. I have all inputs working and the submission of documents is loading in my CMS where everything is stored. EXCEPT the client’s first name, last name and email aren’t populating in my CMS. I already have the PrivateMembersdataset connected to the input fields on the page of their first name, last name and email so that it’s populating on the page. The client shouldn’t have to enter in their own information in the inputs; that’s redundant since they are already logged into their client portal.

How can I transfer the client’s first name, last name and email automatically from the member portal to my CMS?

Chatgpt’s suggestions haven’t proven successful with code. I’m tired of suggestions; I just need workable code or solutions. Thanks!

There is a couple of ways to achieve this.
You should be able to use frontend using your datasets save, but the whole submission would need to be coded.

  • currentMember.getMember() to get the details of the first/last name
  • wixUsers.currentUser.getEmail() returns the logged‑in member’s email on the frontend
import wixUsers from 'wix-users';
import { currentMember } from 'wix-members';

//more code here for all the submission

$w(SUBMISSION_DATASET_ID).onBeforeSave(() => {
    if (firstName) $w(SUBMISSION_DATASET_ID).setFieldValue(FIELD_FIRST, firstName);
    if (lastName)  $w(SUBMISSION_DATASET_ID).setFieldValue(FIELD_LAST,  lastName);
    if (email)     $w(SUBMISSION_DATASET_ID).setFieldValue(FIELD_EMAIL, email);
  });


or a more robust way is set up a data hook on backend

import { members } from 'wix-members-backend';
import { contacts } from 'wix-contacts.v2';
const COLLECTION_ID = 'ClientUploads';

const FIELD_FIRST = 'firstName';
const FIELD_LAST  = 'lastName';
const FIELD_EMAIL = 'email';

These may help you try code whats needed.