Skip to content

Instantly share code, notes, and snippets.

@brianray
Created June 1, 2019 15:28
Show Gist options
  • Save brianray/6846429304e87ed0f5ef5fd9f81efcac to your computer and use it in GitHub Desktop.
Save brianray/6846429304e87ed0f5ef5fd9f81efcac to your computer and use it in GitHub Desktop.
function add_x_y() {
var sheet = SpreadsheetApp.getActiveSheet();
var x = sheet.getRange(2,1);
var y = sheet.getRange(2,2);
data = {"x": x.getValue(), "y": y.getValue()};
var URL = "https://us-central1-mw-automl-first-look.cloudfunctions.net/tutorial" //< Add your URL
var options = {
'method' : 'post',
'contentType': 'application/json',
// Convert the JavaScript object to a JSON string.
'payload' : JSON.stringify(data)
};
return UrlFetchApp.fetch(URL, options).getContentText();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment