Auto-input member name into field for form submission

I am new at the coding end of website building and I am struggling with how to connect a user input button so that it auto-fills with a member’s name when they are logged in. I understand how to connect these fields to the database, but I would like to have them not have to type their name each time they submit. I understand there is code I can paste to make this occur, but I am not sure what it is and where exactly at the bottom of the screen to paste it. Please forgive my learning curve here…
The field I want to connect is the one I have labeled ‘user name’, selected in the image below.
Thank you!

You’ll nedd to add some code that FETCH data from the database and changes the value of that field. You can aslo link usernme to your usernames database that that won’t populate username in the other database (picture).

Hi,

If you have the Users name in your database, you can try filtering the dataset by logged-in user .

Liran.

Hi Hacer,

I had the same issue as well. You can link auto-fill inputs from a database and add other user input fields. Then use setFieldValue function to submit auto-fill inputs to your database.
This website has an example on how to create an auto-fill form, https://www.vorbly.com/Vorbly-Code/WIX-CODE-AUTO-FILL-FORM-WITH-USER-INPUTS .

Good luck!

Ben

Hi dunno if you solved this but i used this, Member profiles contain the full names of my clients and i use this code to pull them onto their own dash board page into a text box named #longNametextbox

import wixData from ‘wix-data’;

export function Submit_click(event) {

const currentItem = $w(“#MemberProfile5”).getCurrentItem();
$w(“#longNametextbox”).text = currentItem.fullName;

$w(‘#MemberProfile5’).setFieldValue(‘longName’, $w(‘#longNametextbox’).text);
}

Hi Liran,
This link no longer works, do you have an updated one?

Thanks, Myles