I'm during my university project and I'm using SurveyMonkey to gather data for my team usage.
To easily read and maintain with the data, I use API Connector Add-On in Google Scheet to download latest responses from Survey Monkey, especially when due to my Uni policy I am the only person who can have access to Survey Monkey in my team.
The problem is that we need to make the data refresh every 5 minutes, as due to the project characteristics the amount of rapidly sent responses have to be monitored by us during 4h window every day and every 5 minutes.
The API Connector allows me to re-run request for data automatically, but only for every 1 hour, which is not sufficient for me and my team. I've tried to use Google Apps Script from that post, but unfortunately I can't modify to make it work due to my lack of knowledge.
function onInstall() {
onOpen();
}
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('Schedule')
.addItem('Start Schedule', 'menuItem3')
.addToUi();
}
function menuItem3() {
createTrigger();
}
function createTrigger()
{
ScriptApp.newTrigger('startProcess')
.timeBased()
.everyDays(1)
.create();
}
function startProcess(){
// Add your processing logic here. e.g. send notifications.
}
Could you please help me and my team? We aren't really a programmer of any kind (economics student) and I'm really struggling with this :(
As I understand, you
- gather information with surveymonkey
- import data from surveymonkey to google sheets
- you want to refresh data from surveymonkey in google sheets every 5 minutes
Well true, you should use triggers
for that.
script
with the next codeHere is an example of code for trigger test purposes
function myFunction(){
// change id by your actual spreadsheet ID
var ss = SpreadsheetApp.openById("id").getSheetByName("Sheet1");
var originalRange = ss.getRange("A1");
var destinationRange = ss.getRange("A2");
originalRange.copyTo(destinationRange);
}
Follow the next step by step guide:
From now on your cell A1 will be copied to A2 every minute, automatically
Knowing this trick you can put your API Connect into myFunction to import data into Google Sheet
I hope this helps you and by the way Google has wonderful service like Google Forms, you can test it as well :)