SL to GoogleSheets
Sep 24, 2015
Hi,
I have been following the threads on getting variables out of SL and into GoogleSheets with interest as I have a tutorial that this would be great to use with. I'm at the testing stage just now and have hit a problem. Can anyone help me out please.
The problem is that the values are not getting posted to the GoogleSheet.
This is my SL to GoogleSheets demo (expires in a few days)
Ive attached the demo zip and a document which its based on for your reference.
6 Replies
Hi Bruce,
Thanks for reaching out here - this is something we'll have to defer to the community for assistance on, as we don't support tracking or reporting to a database or spreadsheet.
Your function add_script() is missing a "
change
add_script("https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js","jquery);
To
add_script("https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js","jquery");
Hi Mark,
Well spotted! I must admit I didn't check that code copied from an article, just shows. Anyway fixed that and also discovered a missing tag in the button code. This code below works if anyone is interested.
// This event could be setup on a button press or a timeline event
var player=GetPlayer();
var name=player.GetVar("name");
var email=player.GetVar("email");
//set this to the form submit address gathered earlier
var fTarget="https://docs.google.com/forms/d/xxxxxxxxxxxxxxxxxxxx/formResponse";
function submit_form(){$.ajax({
url: fTarget,
type: "POST",
data: {"entry.yyyyyyyyyyyyyy" :name,"entry.zzzzzzzzzzzz":email},
success: function(data) {
//won't return since it's cross domain
}
});
return false;
}
//slight delay for older browsers
setTimeout(submit_form(), 2000);
Thanks Bruce for updating the code and for finding the missing element Mark!
Hi Bruce,
Thanks so much for your hard work. It is an excellent method. I spent hours and hours on forums to find a method to take out the variable values from SL to an external file, especially to a google form. I could not find any post except yours.
I downloaded the files you have posted & slightly amended them to suit my resources. Unfortunately, it did not work. I have attached the file. I would be grateful if you could find the mistake I have made. Thanks so much again.
Hi Godfrey,
I'm not sure if Bruce is still subscribed here, although you may be able to reach out to him using the "contact me" button and see if he's able to assist as it's not something our team is able to assist with.
This discussion is closed. You can start a new discussion or contact Articulate Support.