From 35c4d4cae428ec8faa6bfdbecac2376fee0ff56e Mon Sep 17 00:00:00 2001 From: Shannon <22512825+lolipopshock@users.noreply.github.com> Date: Fri, 24 Apr 2020 10:56:10 -0400 Subject: [PATCH] Adapt to the GoogleScript API change --- code.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code.js b/code.js index 67ec6c7..9f71ace 100644 --- a/code.js +++ b/code.js @@ -31,7 +31,7 @@ function initialize() { ScriptApp.deleteTrigger(triggers[i]); } ScriptApp.newTrigger("submitValuesToSlack") - .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet()) + .forForm(FormApp.getActiveForm()) .onFormSubmit() .create(); } @@ -66,14 +66,16 @@ function submitValuesToSlack(e) { // submission, which is passed in as a parameter // https://api.slack.com/docs/message-attachments var constructAttachments = function(values) { - var fields = makeFields(values); + // var fields = makeFields(values); + // The makeFields function seems buggy in the + // new verison, so just comment them out temporarily var attachments = [{ "fallback" : messageFallback, "pretext" : messagePretext, - "mrkdwn_in" : ["pretext"], + //"mrkdwn_in" : ["pretext"], "color" : postColor, - "fields" : fields + //"fields" : fields }] return attachments;