Forum Discussion
SallyMilford
8 years agoCommunity Member
Pulling first name from LMS
Hi all - I'm wondering if anyone might be able to put together a step-by-step guide as to how to set up a variable / javascript function for this? (i.e. pulling a user's first name from the LMS).
...
AndrewFord-ef5b
Community Member
Hi Matthew,
Could you help me with a java script, if I needed to pull in the learners initials from their first and last name from the LMS? (Example, I need Andrew Ford to appear as AF)
Thanks!
KevinBrake-09e3
4 years agoCommunity Member
This may work, untested... let me know:
// Capture first initial from a variable
full_name = full_name.str.charAt(0);
first_name = first_name.str.charAt(0);
or maybe this one:
// Capture first initial from first and last name
var last_name = array[2];
first_name = first_name.substring(0, 1);
last_name = last_name.substring(0, 1);