Forum Discussion
Javascript to pull User Name in Reach 360
Hello! I am wondering if anyone has figured out the javascript to pull the users name from Reach 360.
I set the variable to firstName in Articulate 360 and this is the javascript I put in. Any help is appreciated!
var player = GetPlayer();
function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var firstName = array[1].trim();
var lastName = array[0].trim();
player.SetVar("username", firstName);
1 Reply
- PaulMiller-e5d5Community Member
Hi,
Did you ever find a way to do this? I’m trying to create custom certificates in Storyline (because the default certificates in Reach360 suck) and want to do the same thing. Thanks in advance :)