google-form

Ensure form submission trigger runs only one sheet

回眸只為那壹抹淺笑 提交于 2019-12-31 03:44:25
问题 I have two sheets in a particular spreadsheet both of which have form submissions tied to them. The first sheet/form is supposed to send an email containing the form submission data (the original was created by Amit Agarwal, here's an historic link). The second form/sheet doesn't do anything special as it just collects data from the form. The script in question is set to a On Form Submit trigger. The issue I am having is that the script sometimes runs from form/sheet2. I would like to specify

How to assign a unique ID to a google form input?

时光总嘲笑我的痴心妄想 提交于 2019-12-30 05:07:07
问题 Google Forms - I have set up a google form and I want to assign a unique id each of the completed incoming form inputs. My intention is to use the unique ID as an input for another google form I have created which I will use to link the two completed forms. Is there another easier way to do this? I'm not a programmer but I have programming resources available to me if needed. 回答1: I was also banging my head at this and finally found a solution. I compose a 6-digit number that gets generated

Identifying Form destination (Spreadsheet AND SHEET)

一曲冷凌霜 提交于 2019-12-29 07:17:17
问题 I'm working on a script that interacts with Google Form' response sheet. FormApp.getActiveForm().getDestinationId() give me the spreadsheet id, but I don't find a way to get the sheet itself. User can change its name and position, so I need to get its id, like in Sheet.getSheetId() I also have to determine the number of columns the responses uses. It's not equal to the number of questions in the form. I can count the number of items in the form: Form.getItems().length and then search for

Google Forms onsubmit

和自甴很熟 提交于 2019-12-29 06:48:10
问题 How does one reference the default 'Submit' Forms button to link the 'onsubmit' trigger with another action? Thank you. For example, with onsubmit, Logger.log('do something'); 回答1: One doesn't. The Form Service does not allow any programmatic control over the product. There is an open issue on the Issue Tracker for this general topic. Star it to "vote", and receive updates. However, you're not lost. In the spreadsheet receiving your form responses, you can add a script with an Installable

Find id of element on already made google form?

帅比萌擦擦* 提交于 2019-12-29 05:00:09
问题 I have a form made on google docs, and I have a script that I've just created (that isn't complete) that will analyze the responses on the form, and validate them based on info from a different google doc. Through trial and error I have figured out the id's for all of the elements on said form. I used: var body = "" var bodyTitle = "" for (var i = 1; i < its.length; i ++) { body = body + " " +its[i].getId() bodyTitle = bodyTitle + " " + its[i].getTitle() } and then by logging that out and

Auto incrementing Job Reference

夙愿已清 提交于 2019-12-29 01:56:09
问题 I am very new at writing code and have a limited understanding so please be gentle! I have been trying to expand on the code made on this question. I have had limited success and am now stuck, I was hoping someone would be kind enough to point me in the right direction or tell me what I am doing wrong. So, the scenario: A need to have an auto-incrementing "Job Reference" for booking in netbook repairs to the IT dept I work for. This booking is made via a Google Form and I can get the code in

Accessing user entered data upon submit in google forms

无人久伴 提交于 2019-12-28 13:55:14
问题 I have a google-form that has the following two fields: Email address: - A text box Tool: - A radio button Tool 1 Tool 2 Tool 3 The user would enter his email address and select a tool and click submit. I would like the following message to appear: Thanks for responding. An email has been sent to you to at entered email address to download selected tool . I have the following piece of code in the script editor function emailFormSubmission() { var form = FormApp.getActiveForm();//the current

Sending with Attachments (getFileById)

一曲冷凌霜 提交于 2019-12-25 16:57:33
问题 I created a Google form with a script that automatically sends the data to a particular email whenever someone completes the form. Everything works fine as the script does what it's supposed to do. Here's the entire code function forwardEmail(e) { var forwardEmail = "myemail@myemail.com"; var senderEmail = e.values[1]; var senderName = e.values[2]; var senderLocation = e.values[3]; var senderType = e.values[9]; var studentName = e.values[4]; var broadLeafId = e.values[5]; var cVueId = e

e.source returns Spreadsheet instead of Form object?

早过忘川 提交于 2019-12-25 13:09:53
问题 I create google form 'on the fly' using data in spreadsheet. Also I install trigger on submit form event. ScriptApp.newTrigger('onSubmit') .forForm(form) .onFormSubmit() .create(); onSubmit function placed in the spreadsheet script because there is no way to point the function on the form's side (I make the copy of existent form with script code but it is no use as I can't make that functions run). Well, I process the submission event on the spreadsheet side. No problem. But when I tried to

e.source returns Spreadsheet instead of Form object?

﹥>﹥吖頭↗ 提交于 2019-12-25 13:09:48
问题 I create google form 'on the fly' using data in spreadsheet. Also I install trigger on submit form event. ScriptApp.newTrigger('onSubmit') .forForm(form) .onFormSubmit() .create(); onSubmit function placed in the spreadsheet script because there is no way to point the function on the form's side (I make the copy of existent form with script code but it is no use as I can't make that functions run). Well, I process the submission event on the spreadsheet side. No problem. But when I tried to