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
- CindyPandkeCommunity Member
Thanks everyone for sharing your expertise. It is real helpful to newbies...
We are using Storyline 2 , our LMS is Saba 7.2. The code provided in this thread works great but for only the first time a course is published and uploaded to our LMS. If the file needs to be modified or changed and published a second time then the field (username and/or newName) returns a blank.
Has anyone else experienced this? Is there a known fix that you can share?
Not sure what other information you need to be able to assist. Please let me know and I will do my best to supply it.
- HelenaSmithCommunity Member
We have an outside source that sends emails to the users such as: New User templates, change password/reset
The variable set up for user name is %%susername%%
What type of coding is this?
If I want to set up a text box with the user typing in their names, will i need to use this type of coding??
Hi Helena,
In Storyline you use the % % signs around the name of a variable to reference whatever is being held within that variable (be it text, numeric value, a t/f). This is described here.
If you're looking to pull in code from your LMS, you'll need to look at using some Javascript, which I'll have to defer to the community for.
- HelenaSmithCommunity Member
Ok thank you. Let me take a look.
- HelenaSmithCommunity Member
So the %% signs around the variable make the information unique, as oppose to a single % surrounding the variable?
I haven't seen the double % signs, and that's not a built in feature of Storyline. Are you seeing that in a .story file that you set up or that someone else shared with you? Anymore information you could share would be helpful in terms of identifying that.
- HelenaSmithCommunity Member
In Storyline I have seen the %name% for example but we are using a third party server with our emails and LMS and for usernames they use %%ABC_username%%
I was trying to figure out the difference between one percent sign and two.
Is this Javascript?
Hi Helena,
I would say not - the Javascript that would be used in Storyline is as shown here. You'd likely need to be using Javascript to pull information from the LMS into your Storyline course such as name - and if you need to report to your LMS on variables within Storyline you'll want to use the method here.
- JayDharapCommunity Member
Hey guys! this is almsot exactly what I was looking for...Just that i want to use the first name, not the full name. I tried using just the Array[1] and removing everything else from the JS script but it doesnt work. Suggestions?
- PhilipLima1Community Member
Really hoping someone can help.
I am assuming the answer is something really silly. We have been retrieving the learner name from our LMS on many courses. all of a sudden, it will not work. Here is the slide that retrieves the name. Does anyone have any idea why this won't work?