Exporting Variables

May 19, 2020

Please could someone help me. I've spent hours on this and cannot see why it does not work.

Google form is here:https://docs.google.com/spreadsheets/d/15SrG1I1D1BH5aWxUc3CXzqhGew_zOSHFgOPtVxwUTR4/edit?usp=sharing

Java script in SL is here:

//step 1 //Copy and paste this entire script into a JavaScript trigger in your Storyline file (best to do this at the very beginning of the file) var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.src = '//code.jquery.com/jquery-1.11.0.min.js'; script.type = 'text/javascript'; head.appendChild(script)

The next trigger is:

var player = GetPlayer(); //PLACE YOUR WEB APP URL WEB_APP_URL = "https://script.google.com/macros/s/AKfycbxBVwtM0BZg34F5N6B7VEYUjQV6l_O2vfD8IYGWkhSS_XVbLw/exec"; // STORE ARTICULATE STORYLINE VARIABLES // "Columnname_Google_Spreadsheet" : player.GetVar("Name_Storyline_Variable") // ATTENTION: Use a comma if you use multiple Storyline variables storyline = { "date" : new Date().toJSON().slice(0,10), //STORE DATE "TextEntry1" : player.GetVar("txtEntry1"), } //Don't edit below this line, you're all set :) $.ajax( { url: WEB_APP_URL, type: "POST", data: storyline, success: function(data) { console.log(data); }, error: function(err) { console.log('Error:', err); } }); return false;

 

Why won;t it work????

 

 

 

 

2 Replies

This discussion is closed. You can start a new discussion or contact Articulate Support.