How to query the current logged in member so that an uploaded image will "land" in the right field cell?

Thank you very much Ninja for your pedagogic explanations. I really suck when it comes to coding so it is like when I have to solve an (in my mind) advanced mathematic problem, I just get a headake ; ) Now I will try with your code and without a direct dataset-connection.

I got this redmarking for the signs after “onBeforeSave” so what do you think that can depend on?

Now this is my full code for the members account page and I have not combined it with direct dataset-connections but it doesn´t work. Now I see no picture at all and the picture field cell for the current member is empty so what is wrong?

import { currentMember } from ‘wix-members’ ;
import wixLocation from ‘wix-location’ ;
import wixUsers from ‘wix-users’ ;

setTimeout ( function () {
$w ( “#textBox14” ). show ();
}, 1000 );

$w . onReady ( () => {
$w ( “#dataset3” ). onReady ( () => {
$w ( “#dataset3” ). refresh ()
. then ( () => {
console . log ( “Done refreshing the dataset” );
} );
} );
} );
$w . onReady (()=>{
$w ( ‘#dataset3’ ). onReady (()=>{
$w ( ‘#uploadButton’ ). onChange (()=>{

  $w ( "#uploadButton" ). collapse (); 
  $w ( "#text399" ). collapse (); 
  $w ( "#text400" ). show (); 
  $w ( "#dataset3" ). setFieldValue ( "picture" ); 
  $w ( "#dataset3" ). save (); 
  }); 
});  

});
$w ( ‘#dataset3’ ). onBeforeSave ( () => {

  let  memberID  =  getMemberID ();  console . log ( memberID ); 
  
$w ( "#dataset3" ). setFieldValue ( "picture" ,  "picURL" );    

});

$w ( ‘#dataset3’ ). onAfterSave (()=>{
});

function getMemberID ( ) {
currentMember . getMember ()
. then (( member )=>{
const id = member . _id ;
const fullName =${ member . contactDetails . firstName };
return member ;
}). catch (( error )=>{ console . error ( error );});
}
$w . onReady (() => {
$w ( “#logout” ). onClick ( logoutAndRedirect );
});
function logoutAndRedirect ( event ) {
Promise . all ( [ wixLocation . to ( ‘/login’ ), wixUsers . logout () ] );
}