Skip to Main Content
Installing Conda and PyTorch on NVIDIA DGX Spark Dedicated SFP+ (10GbE+) network ring in ProxMox

Set the user name from the user email address

APEX JavaScript
How to set the user name from the user email address

Example:

function initCap(str){
    return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
}

var email = $v('P1_EMAIL'); 
if (email) {
    var local   = email.split('@')[0];         
    var name    = local.split('.')
                       .map(initCap)           
                       .join(' ');             

    apex.item('P1_NAME')
        .setValue(name) 
}