google-form

Script running multiple times onFormSubmit

十年热恋 提交于 2019-12-11 01:24:57
问题 I have the following code set to run based on a onFormSubmit trigger but it will sometimes run multiple times with the same submission. I want to verify if it already copied the row and if so to stop the script. function toDo(){ var responses = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Form Responses 1"); var jobs = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Jobs"); var lastrow = responses.getLastRow(); var col = responses.getLastColumn(); var row = responses.getRange

Post Google Forms to a MySQL database?

南笙酒味 提交于 2019-12-11 01:09:33
问题 I've had a look around the net, google etc. i can't decipher wether it is possible to post google form data to both a google doc and to a database where the rest of my website is running? The reason for this is so i can allow people with a Google Account to complete large forms or surveys that i can build on the fly nice and easily. Thank you for any enlightening responses 回答1: Yes it is possible with Google Apps Script https://developers.google.com/apps-script/guides/jdbc 来源: https:/

Format text in auto email script

馋奶兔 提交于 2019-12-11 00:31:54
问题 I use the following script to send auto confirmations from a spreadsheet which is synced with a google form. function formSubmitReply(e) { var userEmail = e.values[2]; MailApp.sendEmail(userEmail, "Thanks for Volunteering", " Hello\n\n"+ "Thanks you\n\n"+ "Have a great day\n\n", {name:"ABC"}); }​ The \n takes the text to the next line. However, it's all left aligned. Is there anything I can add to make it right aligned? something like \r ? Thanks 回答1: The text body of an email supports no

Adding a lot of responses with google apps script

风流意气都作罢 提交于 2019-12-10 23:33:09
问题 I want to make a script that will add a lot of(about 1500) CV and candidate info as a response to a form. I have the information as a google spreadsheet. I linked it to form but i can only manage responses. Even if i change the spreadsheet(or add), no update will happen in the form. I am adding lines but no responses added. Is that possible? I saw 2-3 questions about that but they were old and i am still trying to get answers. This is my internship project and i have not much time left.

How to Embed a Google Form in Email in Google App Script

纵饮孤独 提交于 2019-12-10 18:43:12
问题 I have a form that requires login and I am trying to fetch its html to embed in an email. Similar to the question Google Apps Script: how to access or call "Send this form to others"? var form = FormApp.create('New Form'); form.setRequireLogin(true); ... var url = form.getPublishedUrl(); var response = UrlFetchApp.fetch(url); var htmlBody = HtmlService.createHtmlOutput(response).getContent(); MailApp.sendEmail({ to: email, subject: subject, htmlBody: htmlBody, }); ... Howerver, the

Sending users to different sections of survey

℡╲_俬逩灬. 提交于 2019-12-10 12:35:02
问题 So I just created a google forms survey and wondered if its possible to send the users to different sections. I am looking for at way to direct half of the users directly to section 2 and have the other half only see section 1. User 1: Sees only section 1 User 2: Sees only section 2 User 3: Sees only section 1 and so on Is there a way to keep a counter in google scripts that that sends the users directly to a section depending on whenever its odd or even without having them answer any

Create a new sheet in an existing spreadsheet for EACH RESPONSE from a Google Form

一曲冷凌霜 提交于 2019-12-10 11:57:24
问题 I have created a Google form, and I need to create a new sheet in an existing spreadsheet for each response I receive from this form - each respondent generates a new sheet within the spreadsheet. Is this possible with some kind of onSubmit command? I'm completely new to Javascript but willing to learn. Thanks so much for your help. 回答1: You can't intercept a Google Form submission before the data is written into the spreadsheet. All you can do is manipulate the data after it's already been

Google app script trigger not working

自古美人都是妖i 提交于 2019-12-10 03:34:20
问题 I have a google app script which sends email, and i have set a trigger such that it sends email on every form submit. The problem is the trigger works perfectly fine for initial few minutes, but later even after entering correct data. The script does not send the mail, i have to manually press the execution button of the script. Here is my code var EMAIL_SENT = "EMAIL_SENT"; function sendEmailsapp() { var sheet = SpreadsheetApp.getActiveSheet(); var startRow = 2; // First row of data to

Dynamically update Google Form 'Choose from list' options from column in Spreadsheet

Deadly 提交于 2019-12-09 04:26:43
问题 I am trying to setup a Google Form that will create a ' choose from list ' question, with each option being drawn from the rows in a specific column. I have tried this code, but it has not worked for me at all. The code that I have so far is below. I am able to create the desired form question with the data from only one row in the specific column (in this case the last row of the column). If anyone can help by pointing me the right direction as to how to assign each selected row to only one

Sequentially Rename 100+ Columns Having Idiosyncratic Names

我怕爱的太早我们不能终老 提交于 2019-12-09 03:56:02
问题 I have a large data frame imported from a Google Forms survey with very long column names (basically, the column names are the survey questions themselves). So, my imported data frame is like this: d<- data.frame(LongnameLongnameLongnameLongname=1:3,AnotherOneAnotherOneAnotherone=4:6, Etc_Etc_Etc_Etc_Etc=3:5) d GOAL: To replace these long, idiosyncratic column names with a sequential name, such as Q1, Q2, etc. 回答1: Use the colnames function: colnames(d) <- paste0("Q",1:ncol(d)) 来源: https:/