While I hesitate to go against Mary, I think there’s potentially a better way to do this…
Within Google Drive, it’s possible to create a Google Apps Script that you can publish as a web page. That script can do all sorts of fun things in Google Drive (and Gmail). Once you have your script set up, you can do a POST from within a chart or subroutine and pass it data. Here’s an example of a Google Script I’m using in this manner:
/**
* Global objects.
*/
var enSpreadsheet = SpreadsheetApp.openById('xxx');
/*
* Function to test storage function.
*/
function test() {
// Create sample post data string.
var testData = '123456,1,123,10,11,09/27/16,23:26:34,1,HINES,EN,123XYZ,';
// Run storage function.
storePostData(testData);
}
/*
* Function to accept HTTP post. Runs function to store POST data in spreadsheet.
*/
function doPost(e) { storePostData(e.parameter.data); return ContentService.createTextOutput('OK'); }
/*
* Parses post data into separate fields and loads data into bottom of EN spreadsheet.
*/
function storePostData(data) {
// Parse data into fields. Data given as comma separated: SO, Load, Barrel, Minutes, Date, Time, Station, Customer, Part ID, Sub ID.
var fields = data.split(',');
// Position cursor to first empty row in spreadsheet.
var logSheet = enSpreadsheet.getSheetByName('EN Log');
var countRows = logSheet.getDataRange().getLastRow();
var currentCell = logSheet.getRange('A1').offset(countRows, 0);
while (!currentCell.isBlank()) {
currentCell = currentCell.offset(1, 0);
}
// Load data into spreadsheet.
currentCell.setValue(fields[5]);
currentCell.offset(0, 1).setValue(fields[6]);
currentCell.offset(0, 2).setValue('EN ' + fields[7]);
currentCell.offset(0, 3).setValue(fields[0]);
currentCell.offset(0, 4).setValue(fields[8]);
currentCell.offset(0, 5).setValue(fields[10]);
currentCell.offset(0, 6).setValue(fields[11]);
currentCell.offset(0, 7).setValue(fields[1]);
currentCell.offset(0, 8).setValue(fields[2]);
currentCell.offset(0, 9).setValue(fields[3]);
currentCell.offset(0, 10).setValue(fields[4]);
}
I’ve had great luck using this method, and it’s a bit more direct than IFTTT. One thing I don’t like about the IFTTT solution is that you can’t change the polling interval there, so if you need something happen in realtime, you’re out of luck. With my solution, everything happens in realtime. And with Google Apps Script, you can really easily interface with Gmail as well.