Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Want to extract first two letters from first name and first three letters from last name to create UserId

avinashb
Tera Contributor

Hi All,

Can some one help me to extract first two letters from first name and last three letters from last name to create User Id upon submission of form.

Help is always appreciated.

Thanks and Regards,

Avinash balli

5 REPLIES 5

anujdev
Tera Guru

You may Use :



var firstname = 'John';  


var lastname = 'Wayne';  


 


var user = firstname.substring(0,2) + lastname.substring(lastname.length - 3, lastname.length+1);


 


gs.print(user);  



PFA screenshot..


Correct Answer if my code   Works, Mark it helpful if it helps.


Thanks


ANujSharmahttps   dev38176.service now.com sys.scripts.do.png