Forum Discussion
exporting variables to be read in a Google docs spreadsheet
Hi Everyone,
My first post here, but I've been using the product since it was released (and Studio before that). I've been coming back to this thread again and again, but I just can't get this to work. I'm simply trying to export variable data into a Google Sheet.
I've read all the documentation on this thread (several times!), tried multiple variations of the script provided above, and even extracted Michael's user.js in effort to adapt his code -- nothing works! I must be missing something here.. Can someone please take a look at my code and story? I've opened my sheet for public review/editing, so you should be able to see everything from front-to-back.
Thanks!
.Story Attached
My form:
https://docs.google.com/forms/d/1AdbAVu3_ER3cL7o6LcDaMSRUfT5Loo6Hlpvc6TuatLc/viewform
Response Sheet:
Code:
var player = GetPlayer();
var Name = player.GetVar("Name");
var Event = player.GetVar("Event");
$.ajax({
url: "https://docs.google.com/forms/d/1AdbAVu3_ER3cL7o6LcDaMSRUfT5Loo6Hlpvc6TuatLc/formResponse",
data: {"entry.495789985": Name, "entry.647210599": Event},
type: "POST",
dataType: "xml",
statusCode: {
0: function() {
//Success message
},
200: function() {
//Success Message
}
}
});
EDIT:
Removed extra line from original script;
Updated attached .STORY;
added 2nd slide with alternate script:
var player = GetPlayer();
$.ajax({
url: "https://docs.google.com/forms/d/1AdbAVu3_ER3cL7o6LcDaMSRUfT5Loo6Hlpvc6TuatLc/formResponse",
type: "POST",
data: {"entry.495789985" :player.GetVar("Name"), "entry.647210599":player.GetVar("Event")},
success: function(data)
{
alert(data);
}
});
return false;
EDIT2:
I see some activity in the sheet from an hour ago that I didn't do, so I hope someone has made some progress Still unable to get it working my end.