Put User ID automatically in Database if a Post is sent

Hi,
i would like to put the ID of the Person who sent the Post into my database.
But I do not understand how to do this. Can somebody help me please?
Can you send me a code which i have to change a little bit to get it work?
Thanks :slight_smile:

So this might help, thats the code I use

import wixUsers from ‘wix-users’ ;
import wixData from ‘wix-data’ ;

export function button6_onclick() {

let userID = wixUsers.currentUser.id;

let insert = {

“ownerId” : userID,
};

$w.onReady( () => {
$w( “#dataset1” ).onReady( () => {
wixData.insert( “#Entdecken” , insert);
$w( “#dataset1” ).save();
} );
} );

$w( “#dataset1” ).refresh();
}

can anybody help me?