Skip to content

Instantly share code, notes, and snippets.

@MappingKat
Created September 29, 2016 15:42
Show Gist options
  • Save MappingKat/884aaf131a4a4dfcf0887b200ad88f0a to your computer and use it in GitHub Desktop.
Save MappingKat/884aaf131a4a4dfcf0887b200ad88f0a to your computer and use it in GitHub Desktop.
function updateDate (recordID, date) {
var url = "https://api.fulcrumapp.com/api/v2/records/" + recordID + ".json?token=" + fulcrumAPIkey;
var options = {
"method": "GET",
"contentType": "application/json"
};
var recordJSON = UrlFetchApp.fetch(url, options);
// Update record with wx info
var record = JSON.parse(recordJSON);
record.record.form_values["8302"] = date.toString();
// PUT updated record to Fulcrum
var url = "https://api.fulcrumapp.com/api/v2/records/" + recordID + ".json?token="+fulcrumAPIkey;
var options = {
"method": "PUT",
"contentType": "application/json",
"payload": JSON.stringify(record)
};
var recordJSON = UrlFetchApp.fetch(url, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment