Forum Discussion
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. Is there a way to set a variable with data from the LMS when the course is loaded instead of having the user enter their name?
Thx
215 Replies
Hey Sally! It looks like Matthew sent you a handy step-by-step guide in this thread. I wanted to share that link here for anyone else in the thread who wants to do the same thing!
- KayodeArowoloCommunity Member
Hello, I know this thread is old (5 years ago) but I'm hoping that someone can help me. I'm trying to print the name of users on a certificate of completion. The names should be their registered names for the course. I tried the codes but it's not working for me. Please help anyone..Thanks
- KnutJackowskiCommunity Member
Hello Kayode!
There is a more recent thread here about this, that starts with code that works with current Articulate 3 in HTML5 and Flash output.
- KayodeArowoloCommunity Member
Hello for your prompt response. I have read the thread. Where should I copy the JavaScript? I mean on which slide? Thanks Kayode
Thanks so much for popping in to share that thread with Kayode here Knut. Much appreciated and should get them in the right direction.
- KayodeArowoloCommunity Member
Thanks Matthew.
Where should I place the test variables "first - DavidTappendenCommunity Member
Sooo, 4/5 years later I have the same question.
I'm hoping for progress in terms of a solution to this and working with HTML5 - can anybody give an update as to if this works in HTML5 yet?
Many thanks :)
- SteveFlowersCommunity Member
Have been using the methods listed in the thread for years to get this to work with HTML5.
//this might not be required depending on how your LMS nests the API. Try with then comment out if it does not work in a test publish.
lmsAPI=parent;
//This splits the username sent by the LMS by the comma and creates a string Firstname Lastname.
var userName=lmsAPI.GetStudentName().split(',')[1]+" "+lmsAPI.GetStudentName().split(',')[0];
//get storyline's player
var player=GetPlayer();
//set a player variable in your storyline file to the string created above. Make sure the variable exists in Storyline.
player.SetVar("storylineNameVariable",userName);
Works every time for me in HTML5.
- SteveFlowersCommunity Member
The above method should also work with Storyline 2 as well as Storyline 1 (no HTML5 in SL1).
- SteveFlowersCommunity Member
Matthew's find-the-api-automatically method should work as well:
As with all, test it first. I tend to stick with my test and revise method. The approach illustrated at Matthew's link did fail for me once but I didn't take the time to figure out why.
- JochenUlmerCommunity Member
Hello,
I try this script with the Ilias LMS System. But it doesn`t run.
Regards,
Jochen
- JohnCutlack1Community Member
Lots of potential solutions here from the community but does anybody have a script that is known to be able to pass a student's name from SAP's SuccessFactors LMS to a SCORM object produced in SL2?
- AxelDitter-66bbCommunity Member
good question: need the same solution ... but can t find it (for sucess factors)
any idea?
cheers
Axel
Related Content
- 3 years ago
- 9 months ago
- 9 months ago