Explore the community Forums Lectora Lectora Questions & Answers Pull variable from LMS and insert into text box Reply To: Pull variable from LMS and insert into text box

#419020 Score: 1
Profile photo of Tim K
Tim K
Member
contributor
beginner
intermediate
advanced
friend finder
junior moderator
advocate
wise owl
curious george
Group Member
354 pts
@timk

The best way should be to assign the value to a user-defined variable so that you can use it as usual from that point on. Create a variable, e.g. “username”.

You need to use it in a Lectora action to initialize it, otherwise it wouldn’t exist. Maybe “Set as empty” when the page is loaded, just make sure it’s done before the javascript is executed.

The code should be:

Varusername.set(icwStudentName);

Then you can use “username” in any way, e.g. in a Change contents action. Inline variable replacement probably won’t work on the page the code is run but should work on all pages that come later.

This post has received 1 vote up.