Google Form - Using Apps Script to Populate Google Sheet

  Рет қаралды 104,441

Code With Curt

Code With Curt

Күн бұрын

Пікірлер: 53
@williamm5947
@williamm5947 2 жыл бұрын
Thank you very much, I and the operations users of my company appreciate it. Greetings from Colombia
@joaquimdias7209
@joaquimdias7209 Жыл бұрын
Hi Curt, thanks for the code, it has been very helpful. I have a question, if my form consists of two different sections how do I pass the answer of the second section to a new line in sheets without deleting the line with the answers of the first section, who will be the above line of this new one? Thanks.
@CodeWithCurt
@CodeWithCurt 3 жыл бұрын
Google Apps Script Code in Video Below: function onFormSubmit(event) { record_array = [] var form = FormApp.openById(''); // Form ID var formResponses = form.getResponses(); var fromCount = formResponses.length; var formResponse = formResponses[fromCount - 1]; var itemResponses = formResponse.getItemResponses(); for (var j = 0; j < itemResponses.length; j++) { var itemResponse = itemResponses[j]; var title = itemResponse.getItem().getTitle(); var answer = itemResponse.getResponse(); Logger.log(title); Logger.log(answer); record_array.push(answer); } AddRecord(record_array[0], record_array[1], record_array[2]); } function AddRecord(first_name, last_name, color) { var url = ''; //URL OF GOOGLE SHEET; var ss= SpreadsheetApp.openByUrl(url); var dataSheet = ss.getSheetByName("Sheet1"); dataSheet.appendRow([first_name, last_name, color, new Date()]); }
@nicebackingup
@nicebackingup 3 жыл бұрын
sir can you trap duplicate entry in google form just like ACCESS CODE. what is the script behind that. thank you.
@2JSinc
@2JSinc 3 жыл бұрын
Good day sir, is it possible make it the other way around? Dynamically change google form's questions from google sheets, i.e. in Form question number 1, a list of car models, be in dropdown list or the selectin list from sheets then question number 2 would dynamically change depending on the selection in question 1. basically an EASY CRUD version of google form, hope I make sense somehow. right now I still can't digest the manual doing of the CRUD web app... Thanks
@fastcookingtechniques
@fastcookingtechniques Жыл бұрын
can possible to customize the form layout into 3 or 4 columns using app script?
@mawuenaakwayena3056
@mawuenaakwayena3056 Жыл бұрын
Great video Curt! Got a few questions if ya don't mind. Firstly, are they advantages to using apps scripts to populate the google sheet as opposed to just linking the form to the sheet? Secondly, do the questions on the google form need to match the column names in the google sheet that the responses are populated with? for example, if a question on the form is "What is your date of birth?" can the corresponding column name in sheets be "Birthdate?" Thanks mate!
@vb6328
@vb6328 Жыл бұрын
Good day sir, is there a way to make a reverse thing like I want to populate the google form using the datas from the spreadsheet using the app script?
@SalAbraham7
@SalAbraham7 Жыл бұрын
But Google forms responses are automatically populated to Spreadsgsheet without the need to use this script
@genesiscatano
@genesiscatano Жыл бұрын
Yes, but if you want to do another things with this data you have to do importrange. This is very helpful for what I'm trying to acumplish. I want to be able to select multiple people and add it to a list. Right now you can do it with check boxes to multi select but they come in one cell, then you have to split it. Now with this I can split it with the script and display the data directly.
@mattijzer
@mattijzer Жыл бұрын
@@genesiscatano can you explain how I can manage to use the functionality as you described. So I have a google forms questions which allows multiple selections. In google sheets this comes back in one cell as follows: answer1,answer2,answer3... etc. I would like to have these answers in seperate cells in seperate rows.
@gamesworld_all
@gamesworld_all 3 жыл бұрын
Can you please tell me how to get drop-down and check box values into sheets
@kevinnichols9836
@kevinnichols9836 2 жыл бұрын
Did you type all that script or was it automatic from the creation of the form?
@dansouza3043
@dansouza3043 2 жыл бұрын
Great video!!! What would be the script if I have check boxes with the multiple choice questions?
@robertwickberg5596
@robertwickberg5596 Жыл бұрын
I want to create a form that logs something that gives me a clue as to who or what workstation, or something, submitted the form, without asking the user who they are, so I can see if people are submitting multiple answers without making them log into google when using the sheet. Seems like if I just add one more parameter to the appendrow function, that would do it. But what? is there a function that can access the responder's ip address, or workstation name, or location (the answers will all come from managed chromebooks, I can specify location in the admin console)?
@zerox4224
@zerox4224 3 жыл бұрын
BTW if u submit 2 responses from separate devices at the same time, in the excel file it only shows one of the responses but it duplicates it.
@spirationmusic
@spirationmusic Жыл бұрын
hmm looks like when setting up new form triggers there is no longer the permission for viewing and opening sheets. How can that permission be added since this method does not work anymore?
@d04ak
@d04ak Жыл бұрын
Here's an example of an Apps Script code that retrieves form responses from Google Forms and inserts them into a Google Sheets spreadsheet: javascript Copy code function onFormSubmit(e) { var formResponse = e.response; var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0]; var row = []; headers.forEach(function(header) { var value = formResponse.getResponseForItem(header); row.push(value ? value.getResponse() : ''); }); sheet.appendRow(row); } To set up this code: Open your Google Forms. Click on the vertical ellipsis (⋮) in the upper-right corner. Select "Script editor" from the menu. This will open the Apps Script editor in a new tab. In the Apps Script editor, replace any existing code with the provided code. Save the script by clicking on the floppy disk icon or pressing Ctrl+S. Close the Apps Script editor tab. Go back to your Google Form. Click on the vertical ellipsis (⋮) again and select "Script editor" to reopen the Apps Script editor. In the Apps Script editor, click on the "Triggers" icon (clock-shaped) on the left sidebar. Click on the "+ Add Trigger" button. Configure the trigger settings as follows: Choose which function to run: onFormSubmit Choose which deployment should run: Head Select event source: From form Select event type: On form submit Click "Save" to create the trigger. Now, whenever a form response is submitted, the onFormSubmit function will be triggered, and it will add the response to the active sheet of your Google Sheets spreadsheet. Make sure to have the corresponding headers in the first row of the sheet to match the form question titles. Note: Remember to save and set up the trigger for the script to work correctly.
@patriciamonserrat9851
@patriciamonserrat9851 2 жыл бұрын
Is it possible to use the Apps Script to resend a google form with the same answers for over a period of time?
@organickrishi5679
@organickrishi5679 9 ай бұрын
Please provide a small project where data display in google forms from Google Sheet by search option
@andresmichael359
@andresmichael359 3 жыл бұрын
Hi, I just made a Google form and link it with a spreadsheet, but suddenly the number of responses doesn't correspond to the number on the spreadsheet, I got 23 response on the form and only got 20 on the spreadsheet, and I don't know how it happen. Is it a bug or something? Is there any way to fix?. Thank u for anyone who would answer my question.
@pramodvajire4471
@pramodvajire4471 3 жыл бұрын
I feel the script is able to run one item at a time. If that is the case, we can use safety precautions as such one write at a time, and other requests standing in a queue.
@m.caeben2578
@m.caeben2578 2 жыл бұрын
​@@pramodvajire4471, that seems like a good idea. Where could I get info to let the forms stand in queue as mentioned?
@ashishjain8588
@ashishjain8588 2 жыл бұрын
Similar problem 3 responses missing , how did you resolved it ?
@tomcox8801
@tomcox8801 Жыл бұрын
Curt, can you make a script that will allow me to enter a field on a Form and search the linked Spreadsheet for an existing match and then populate the Form with the data from the Sheet?
@zip7354
@zip7354 Жыл бұрын
PLEASE WE WANT THIS VIDEO
@jvn-117
@jvn-117 Жыл бұрын
Yes please
@phsd1307
@phsd1307 Жыл бұрын
I want this! Please!
@kensleylewis
@kensleylewis Жыл бұрын
Yes please!
@fastcookingtechniques
@fastcookingtechniques Жыл бұрын
or can we create like a repeat table on google form?
@joannegott2732
@joannegott2732 2 жыл бұрын
I’m a complete newbie. I need my form to send data to more than one sheet. How do I make this script send to two sheets. Added bonus if you could explain how to set it up in a different column so that it goes to the next row, but starts in column B instead of A. I hope that make sense!
@udplearn2207
@udplearn2207 2 жыл бұрын
How to give URL of uploaded photos in google sheet
@quachkhoaduy7565
@quachkhoaduy7565 3 жыл бұрын
Tks Curt so much! Interesting video!
@kennymarutha8687
@kennymarutha8687 3 жыл бұрын
Thanks a lot for this.. don't you have one where you convert/translate the google sheets into google docs table...?
@CodeWithCurt
@CodeWithCurt 3 жыл бұрын
This is the closest video I have to that. kzbin.info/www/bejne/qXumk3dpgax6q9E
@minimaggot269
@minimaggot269 3 жыл бұрын
Why did you do this, when Google Forms does this anyway ?
@satur5751
@satur5751 3 жыл бұрын
To demonstrate how to use apps script, this is helpful when you want to customize / do some business logic on how the record will store in google sheet.
@profocelsomarin4123
@profocelsomarin4123 2 жыл бұрын
is there a way to get the answer of an item, but not when finishing the form? Let me explain: I think of making a dropdown menu dependent on what the user marks in a test. So, in one section the user marks an option, and in the next section the options are loaded according to this answer.
@blessedkanu16
@blessedkanu16 2 жыл бұрын
You can achieve this with conditional questions, you will have to set the question as multiple choice, then close to the "required icon", click on the three dots and select "Go to section based on answer".
@profocelsomarin4123
@profocelsomarin4123 2 жыл бұрын
@@blessedkanu16 thanks for the reply, but I wonder if this would be possible with script. If the response in one section of the form could be used as a variable to then generate changes in the next section of the form
@chakrantmothsara
@chakrantmothsara 3 жыл бұрын
How to m make table to collect data in google form?
@theharcoms
@theharcoms 2 жыл бұрын
How to upload image to spreafsheet wirh apps acript, thanks
@emmanuelgandelman9024
@emmanuelgandelman9024 Жыл бұрын
U can’t upload a file to a sheet but u might get a url to google drive
@SalAbraham7
@SalAbraham7 Жыл бұрын
You will get the URL in the column of Photo and then you can make anouther clomn and use the formula "=image("URL") to preview the image
@daletnt
@daletnt 2 жыл бұрын
Great Video, how would you implement a linear scale question?
@spirationmusic
@spirationmusic Жыл бұрын
amazing video sir. Thanks!
@kevinnichols9836
@kevinnichols9836 2 жыл бұрын
Can you write a script that can duplicate a row the number of times a comma appears in a column? I have a Google Form that's for scheduling appointments for blower door testing and sometimes there are multiple addresses for one appointment. However, I need each address to be it own entry with the same base info(first name, last name, company name, date requested, etc..)? Is this possible? Is this difficult? Anything? LOL
@kevinnichols9836
@kevinnichols9836 2 жыл бұрын
My form and sheet are linked. I thought to use functions/formulas but I don't think I know what I'm doing
@barendsteenekamp3853
@barendsteenekamp3853 2 жыл бұрын
I can only think of the SPLIT() function once in Google Sheets. =SPLIT(text, ",") Then you would have an address per column across; maybe put that right at the end so that no data is overwritten. =TRANSPOSE(SPLIT()) Would do the same for the addresses but in rows. The rest of the data wouldn't be carried into those rows though
@DoYouDJ
@DoYouDJ Жыл бұрын
SO think you would have a hit with combining this with your Creating a estimate geneerator using a form builder as those two would combine the most commonly sought out videos of what people want to do for learning programming like this in the first place. However if you already did it than clap clap cause I find myself coming back to learning form you more than any other programmer to sheer tone of voice and non schalant BS lets getr done attitude. Clap clap again.
@Jaxx-b2g
@Jaxx-b2g 11 ай бұрын
Yo Chode why you using that Google form from windows 98? They got running water where you from?
@miskairali2762
@miskairali2762 2 жыл бұрын
why do you made this video and what the reason behind it, if you made video so you had to pull the data through google sheet in google form reverse video , you should to made it
@benoliraoreynanescueta5517
@benoliraoreynanescueta5517 Жыл бұрын
Hi
Auto Fill Google Doc from Google Form Using Google Apps Script
15:00
Jeff Everhart
Рет қаралды 194 М.
Google Apps Script Tutorial for Beginners
23:54
saperis
Рет қаралды 384 М.
the balloon deflated while it was flying #tiktok
00:19
Анастасия Тарасова
Рет қаралды 34 МЛН
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
HOOOTDOGS
Рет қаралды 3 МЛН
Сюрприз для Златы на день рождения
00:10
Victoria Portfolio
Рет қаралды 2,7 МЛН
Google Forms - Populate Options on Questions From Google Sheets
10:57
Code With Curt
Рет қаралды 69 М.
Google Form Custom UI
13:49
Trabant Technology Partners
Рет қаралды 54 М.
How to Automatically Update your Google Form Options
11:24
Bootstrapping Tools
Рет қаралды 28 М.
Don’t Use Google Forms Without These FREE Add-Ons!
16:03
Simpletivity
Рет қаралды 61 М.
Google Forms - Drop Down List from Spreadsheet Using Apps Script
34:39
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 445 М.
Contact Form to Sheets to Email in Apps Script
16:22
She Designs Things
Рет қаралды 2,4 М.
Apps Script Tutorial on doGet ( )
9:44
Allen App Tools
Рет қаралды 67
Google Apps Script: Creating Managing, and Automating Projects with Script
1:54:55