Forum Discussion
BrettRockwood
13 years agoCommunity Member
Can I revisit this topic again? Using Phil's JavaScript I can get the student's full name from the LMS no problem. But I'd like to just get the first name to put a little personalization into the training, e.g. "Hi Erika, welcome to today's session...". How would I need to modify the script to pull just the first name?
Here is the full name script:
var player = GetPlayer();
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1] + ' ' + array[0];
player.SetVar("newName", newName);
//myName = player.GetVar('myName');
//player.SetVar("newName", newName);
Thanks as always.