How to check if there's new data added on Google SheetHow to check empty/undefined/null string in JavaScript?How do I check if an element is hidden in jQuery?How do I check if an array includes an object in JavaScript?How to check if a string “StartsWith” another string?How do you check if a variable is an array in JavaScript?How to check whether a string contains a substring in JavaScript?How to check for “undefined” in JavaScript?How to check if an object is an array?How does data binding work in AngularJS?How to add an API Key to a UrlFetchApp in Google Apps Scripts
Can external light meter replace the need for push/pull?
Is a switch from R to Python worth it?
Decode a variable-length quantity
How many years before enough atoms of your body are replaced to survive the sudden disappearance of the original body’s atoms?
12V lead acid charger with LM317 not charging
Pronouns when writing from the point of view of a robot
What are these mathematical groups in U.S. universities?
Colleagues speaking another language and it impacts work
How to continue a line in Latex in math mode?
Why ReLU function is not differentiable at 0?
Can chords be inferred from melody alone?
Does the Voyager team use a wrapper (Fortran(77?) to Python) to transmit current commands?
Did silent film actors actually say their lines or did they simply improvise “dialogue” while being filmed?
Purchased new computer from DELL with pre-installed Ubuntu. Won't boot. Should assume its an error from DELL?
Print only the last three columns from file
What does VB stand for?
Getting an entry level IT position later in life
Why is Chromosome 1 called Chromosome 1?
Is it a bad idea to offer variants of a final exam based on the type of allowed calculators?
How to draw a flow chart?
What is an air conditioner compressor hard start kit and how does it work?
Can you use the Help action to give a 2019 UA Artillerist artificer's turret advantage?
What are the examples (applications) of the MIPs in which the objective function has nonzero coefficients for only continuous variables?
How do these cubesats' whip antennas work?
How to check if there's new data added on Google Sheet
How to check empty/undefined/null string in JavaScript?How do I check if an element is hidden in jQuery?How do I check if an array includes an object in JavaScript?How to check if a string “StartsWith” another string?How do you check if a variable is an array in JavaScript?How to check whether a string contains a substring in JavaScript?How to check for “undefined” in JavaScript?How to check if an object is an array?How does data binding work in AngularJS?How to add an API Key to a UrlFetchApp in Google Apps Scripts
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am just new with Google Sheet and Script. Every time a user send a survey through Google Form, the answers were saved to Google Sheet. How do I check if there's added data using Google Script? Because once it detected a new answer I want to get the email address on that answer and do a get request to my site's API.
function myFunction()
var response = UrlFetchApp.fetch("http://example.com/api/" + emailFromSheet);
Logger.log(response.getContentText());
javascript google-apps-script google-sheets triggers
add a comment |
I am just new with Google Sheet and Script. Every time a user send a survey through Google Form, the answers were saved to Google Sheet. How do I check if there's added data using Google Script? Because once it detected a new answer I want to get the email address on that answer and do a get request to my site's API.
function myFunction()
var response = UrlFetchApp.fetch("http://example.com/api/" + emailFromSheet);
Logger.log(response.getContentText());
javascript google-apps-script google-sheets triggers
add a comment |
I am just new with Google Sheet and Script. Every time a user send a survey through Google Form, the answers were saved to Google Sheet. How do I check if there's added data using Google Script? Because once it detected a new answer I want to get the email address on that answer and do a get request to my site's API.
function myFunction()
var response = UrlFetchApp.fetch("http://example.com/api/" + emailFromSheet);
Logger.log(response.getContentText());
javascript google-apps-script google-sheets triggers
I am just new with Google Sheet and Script. Every time a user send a survey through Google Form, the answers were saved to Google Sheet. How do I check if there's added data using Google Script? Because once it detected a new answer I want to get the email address on that answer and do a get request to my site's API.
function myFunction()
var response = UrlFetchApp.fetch("http://example.com/api/" + emailFromSheet);
Logger.log(response.getContentText());
javascript google-apps-script google-sheets triggers
javascript google-apps-script google-sheets triggers
edited Mar 27 at 7:47
TheMaster
13.7k3 gold badges11 silver badges38 bronze badges
13.7k3 gold badges11 silver badges38 bronze badges
asked Mar 27 at 5:22
user3569641user3569641
3628 silver badges31 bronze badges
3628 silver badges31 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There are triggers to do stuff when something happens in a spreadsheet/sheet. onFormSubmit
is such a trigger. You can use it to do stuff when form is submitted.
Read more about this installable trigger here and use below code to install the trigger. Read Managing triggers manually section and use form submit event for your needs.
Paste this code then put email column index as specified in code. Save.
Try running the function from script editor by Run > Function > onFormSubmit
It'll ask for authorization, accept. This run will show an error such as e is not defined
but don't panic. Test code by submitting the form.
function onFormSubmit(e)
// get email from last submitted values
// put correct col index here in place of 0
// col A = 0, col B = 1 and so on ...
var emailFromSheet = e.values[0];
var response = UrlFetchApp.fetch('http://example.com/api/' + emailFromSheet);
Logger.log(response.getContentText());
1
There's onFormSubmit trigger, which has more advantages.
– TheMaster
Mar 27 at 7:48
1
Thanks. Edited code and instructions and included link to resource.
– ra89fi
Mar 27 at 9:15
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370297%2fhow-to-check-if-theres-new-data-added-on-google-sheet%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are triggers to do stuff when something happens in a spreadsheet/sheet. onFormSubmit
is such a trigger. You can use it to do stuff when form is submitted.
Read more about this installable trigger here and use below code to install the trigger. Read Managing triggers manually section and use form submit event for your needs.
Paste this code then put email column index as specified in code. Save.
Try running the function from script editor by Run > Function > onFormSubmit
It'll ask for authorization, accept. This run will show an error such as e is not defined
but don't panic. Test code by submitting the form.
function onFormSubmit(e)
// get email from last submitted values
// put correct col index here in place of 0
// col A = 0, col B = 1 and so on ...
var emailFromSheet = e.values[0];
var response = UrlFetchApp.fetch('http://example.com/api/' + emailFromSheet);
Logger.log(response.getContentText());
1
There's onFormSubmit trigger, which has more advantages.
– TheMaster
Mar 27 at 7:48
1
Thanks. Edited code and instructions and included link to resource.
– ra89fi
Mar 27 at 9:15
add a comment |
There are triggers to do stuff when something happens in a spreadsheet/sheet. onFormSubmit
is such a trigger. You can use it to do stuff when form is submitted.
Read more about this installable trigger here and use below code to install the trigger. Read Managing triggers manually section and use form submit event for your needs.
Paste this code then put email column index as specified in code. Save.
Try running the function from script editor by Run > Function > onFormSubmit
It'll ask for authorization, accept. This run will show an error such as e is not defined
but don't panic. Test code by submitting the form.
function onFormSubmit(e)
// get email from last submitted values
// put correct col index here in place of 0
// col A = 0, col B = 1 and so on ...
var emailFromSheet = e.values[0];
var response = UrlFetchApp.fetch('http://example.com/api/' + emailFromSheet);
Logger.log(response.getContentText());
1
There's onFormSubmit trigger, which has more advantages.
– TheMaster
Mar 27 at 7:48
1
Thanks. Edited code and instructions and included link to resource.
– ra89fi
Mar 27 at 9:15
add a comment |
There are triggers to do stuff when something happens in a spreadsheet/sheet. onFormSubmit
is such a trigger. You can use it to do stuff when form is submitted.
Read more about this installable trigger here and use below code to install the trigger. Read Managing triggers manually section and use form submit event for your needs.
Paste this code then put email column index as specified in code. Save.
Try running the function from script editor by Run > Function > onFormSubmit
It'll ask for authorization, accept. This run will show an error such as e is not defined
but don't panic. Test code by submitting the form.
function onFormSubmit(e)
// get email from last submitted values
// put correct col index here in place of 0
// col A = 0, col B = 1 and so on ...
var emailFromSheet = e.values[0];
var response = UrlFetchApp.fetch('http://example.com/api/' + emailFromSheet);
Logger.log(response.getContentText());
There are triggers to do stuff when something happens in a spreadsheet/sheet. onFormSubmit
is such a trigger. You can use it to do stuff when form is submitted.
Read more about this installable trigger here and use below code to install the trigger. Read Managing triggers manually section and use form submit event for your needs.
Paste this code then put email column index as specified in code. Save.
Try running the function from script editor by Run > Function > onFormSubmit
It'll ask for authorization, accept. This run will show an error such as e is not defined
but don't panic. Test code by submitting the form.
function onFormSubmit(e)
// get email from last submitted values
// put correct col index here in place of 0
// col A = 0, col B = 1 and so on ...
var emailFromSheet = e.values[0];
var response = UrlFetchApp.fetch('http://example.com/api/' + emailFromSheet);
Logger.log(response.getContentText());
edited Mar 27 at 9:15
answered Mar 27 at 5:52
ra89fira89fi
9941 gold badge6 silver badges8 bronze badges
9941 gold badge6 silver badges8 bronze badges
1
There's onFormSubmit trigger, which has more advantages.
– TheMaster
Mar 27 at 7:48
1
Thanks. Edited code and instructions and included link to resource.
– ra89fi
Mar 27 at 9:15
add a comment |
1
There's onFormSubmit trigger, which has more advantages.
– TheMaster
Mar 27 at 7:48
1
Thanks. Edited code and instructions and included link to resource.
– ra89fi
Mar 27 at 9:15
1
1
There's onFormSubmit trigger, which has more advantages.
– TheMaster
Mar 27 at 7:48
There's onFormSubmit trigger, which has more advantages.
– TheMaster
Mar 27 at 7:48
1
1
Thanks. Edited code and instructions and included link to resource.
– ra89fi
Mar 27 at 9:15
Thanks. Edited code and instructions and included link to resource.
– ra89fi
Mar 27 at 9:15
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370297%2fhow-to-check-if-theres-new-data-added-on-google-sheet%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown