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....
SteveFlowers
9 years agoCommunity Member
Give this a shot:
var player = GetPlayer();
lmsAPI=parent;
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1];
player.SetVar("newName", newName);
- JamesBonney-EDE9 years agoCommunity Member
Steve, I salute you. Once again helping me out on here.
Really appreciate, thank you!
- RickForgeard8 years agoCommunity Member
Hi Steve,
I am using your JS code above and am pointing to a text field object called "Name".
Can you offer some suggestions as to what I might be doing wrong. See attached.
I am using SL2 update 11 with SumTotal.
Thanks Rick
- BrianAllen8 years agoCommunity Member
Rick, we also use SumTotal. I've got a couple of working examples of this script in Storyline 2 that we've tested in SumTotal. Let me know if you have trouble getting things working.