How to programmatically set Webform field value with custom submit?
The solution with hook_ENTITY_TYPE_presave :

use Drupal\webform\WebformSubmissionInterface;

 function MODULE_webform_submission_presave(WebformSubmissionInterface $webform_submission){
    global $base_url;
    $user_id_created    = null;

    //Info account
    $account_name       = $webform_submission-&gt;getElementData('nom');
    $account_username   = $webform_submission-&gt;getElementData('username');
    $account_first_name = $webform_submission-&gt;getElementData('prenom');
    $account_mail       = $webform_submission-&gt;getElementData('email');
    $account_password   = $webform_submission-&gt;getElementData('mot_de_passe');
    $account_phone      = $webform_submission-&gt;getElementData('telephone');

    if (!empty($account_username) &amp;&amp; !empty($account_password) &amp;&amp; !empty($account_mail)) {

      $account_username   = strtolower(str_replace(' ', '', $account_username)).'_'.rand(0,1000);

      $user_created       = User::create([
        'name'                  =&gt; $account_username,
        'pass'                  =&gt; $account_password,
        'mail'                  =&gt; $account_mail,
        'field_user_nom'        =&gt; $account_name,
        'field_user_prenom'     =&gt; $account_first_name,
        'field_user_telephone'  =&gt; $account_phone['phone'],
        'status'                =&gt; 0,
        'init'                  =&gt; $account_mail,
        'created'               =&gt; time(),
        'changed'               =&gt; time(),
        'login'                 =&gt; 0,
        'access'                =&gt; 0,
      ]);
      $user_created-&gt;save();
      $user_id_created = $user_created-&gt;id();
      $token_uid       =  $base_url .'/user/' . $user_id_created;
      $webform_submission-&gt;setElementData('token_uid', $token_uid);
    }
  }