Forum Discussion
How to insert current date variable into a "customised certificate slide".
Hi there,
I have created a certificate looking slide at the end of my course. I have added in variables for the learners name, their score achieved, I am just missing the date variable to be populated automatically.
I have followed the guide on the link below however it has not worked when I have tested it in a clients LMS (SABA). https://vimeo.com/145579723
I was just wondering if anyone could offer any assistance on this matter?
31 Replies
- JohnBlumCommunity Member
I tried to use this, but the value of the textbox was a blank space.
I have a blank slide with a textbox containing the text"= %system_date%" was a blank space.
This is the first time I tried using JavaScript in Storyline. don't know why it's not working. Any help would be appreciated.
Thanks for stepping in, Joanne, with your scripting super skillz :)
- JoanneChenSuper Hero
Hi Mitzi, follow the steps below and you should be able to show the date
- Create a text variable called 'SystemDate'
- Create a text box for reference to the variable 'SystemDate'
- Add a trigger - execute Javascript when timeline starts the certificate looking slide
- Copy and paste the code below in the Script coloumn
var m_names = new Array("January", "February", "March",
"April", "May", "June", "July", "August", "September",
"October", "November", "December");
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth();
var yyyy = today.getFullYear();
if(dd<10) { dd='0'+dd }
var date= m_names[mm]+' '+dd+', '+yyyy;
var player = GetPlayer();
player.SetVar("SystemDate",date);- VickieSubletteCommunity Member
Do you know how to make it appear in date/month/year format? For example, 12 September 2020
- NatalieBowmanCommunity Member
Hi, this worked for me.
var m_names = new Array(" January", " February", " March",
" April", " May", " June", " July", " August", " September",
" October", " November", " December");
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth();
var yyyy = today.getFullYear();
if(dd<10) { dd='0'+dd }
var date= ' '+dd+m_names[mm]+', '+yyyy;
var player = GetPlayer();
player.SetVar("SystemDate",date);
Related Content
- 12 months ago
- 4 months ago
- 11 months ago