Skip to content

Instantly share code, notes, and snippets.

@brianray
Last active June 1, 2019 15:30
Show Gist options
  • Save brianray/f700aeba433a99ff3690303a3fb4c58c to your computer and use it in GitHub Desktop.
Save brianray/f700aeba433a99ff3690303a3fb4c58c 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()};
// TODO: Add your URL below
var URL = "https://us-central1-mw-automl-first-look.cloudfunctions.net/tutorial"
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