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
Thanks for sharing Lucio :) There's a wealth of knowledge on the forums for sure.
- JulieJones-2ecbCommunity Member
This post is over four years old and I was wondering if there is an example for Storyline 2 and one that actually works with HTML5? Thanks!
Hi Julie - JavaScript coding is not something that is supported by Articulate, but there is a lot of information here and much more recent than when the thread was started. Hopefully you'll find something to best assist you or someone will be able to chime in and assist.
- HelenaSmithCommunity Member
I think I am confused regarding JS not supported in Storyline...we have JS codes for various things so how is it not supported?
Thank you
- SteveFlowersCommunity Member
Hi, Julie -
This one works fine for me in HTML5. The problem with the beginning of the thread was the use of a function that only worked in Flash. The example below is available to both Flash and HTML5:
https://community.articulate.com/discussions/articulate-storyline/retrieve-lms-user-name-as-variable?page=6#reply-388873var player = GetPlayer();
lmsAPI=parent;
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1];
player.SetVar("newName", newName);
- SteveFlowersCommunity Member
JS *works* in Storyline. Because it's a great big topic and is an extension of Storyline (not a core function) Articulate support staff cannot *support* JS in Storyline. Falls outside the definition of support at the moment.
There is good news! The community is full of folks willing to help out and offer advice.- HelenaSmithCommunity Member
Well that is good to know. I hope for SL3 or 360 JS gets support because many people tend to have questions.
Could not have said that better myself Steve :) Thanks!
Hey Rick - perhaps you're just having difficulty with the older file. Re-attaching here for you to try as Wendy's suggestion should assist :)
- RickForgeardCommunity Member
Thanks Wendy and Leslie.
I was able to open the file. Will let you know how it goes.
Rick
- WendyFarmerSuper Hero
Hi Rick
what is in the ... code window and do you want the code to Execute when the timeline of the slide starts - you have it set on the variable 'name'.
Glad that was able to assist Rick :) Thanks for letting me know. Good luck with your project.
- RickForgeardCommunity Member
Thanks again Wendy and Leslie,
That did it. FYI, I triggered it on the timeline.
Rick
Related Content
- 3 years ago
- 9 months ago
- 9 months ago