Forum Discussion
AndrewRost
13 years agoCommunity Member
Retrieve LMS User Name as Variable
I know you can have a user fill in a text box with their name and then later use that variable for personalization. What we would like to do is programmatically retrieve the user name from the LMS....
anoyatis
Community Member
Hi Brett,
You should be good to go this to capture only first name :
var player = GetPlayer();
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[0];
player.SetVar("newName", newName);
rathnakumaran-f
7 years agoCommunity Member
Thanks a ton! Alex for sharing this script to capture only first name from LMS.