Thanks for this tutorial! It really helped me understand how to use AppScripts better and make my Google form more dynamic. I was a bit confused by your syntax when you're making the array of Form Items, with the id and name. In your forEach loop, you are placing things in a new array but since you aren't assigning that to anything, that array is not retained. I found a more efficient method to get the array shape needed by using .map(). This avoids that need for a separate splitArray() function. let items = form.getItems(); let itemIds = items.map(item => [item.getTitle(), item.getId()]);
@michadybczak486221 күн бұрын
Thanks! That still works in 2024 :)
@shaunaaltman8369Ай бұрын
That’s pretty cool!
@lafamillecarrington2 ай бұрын
The problem I have with this type of formula is that, because it is text, it won't sort correctly (you get row 1, then row 10 etc). I had considered using the time stamp, but it isn't very user-friendly - which is important for my use.
@dagvidar25962 ай бұрын
You need to zoom in your sheets for us to see
@redtailfanschool2 ай бұрын
Thanks for the heads up, I'll make the adjustments next time, I appreciate the feedback
@RobKoziol2 ай бұрын
Hi, this script seems exactly what I need however when trying to save it per your video i receive a Syntax error message as follows: Unexpected token 'const line" 6 file: Code.gs. Any idea what this means and how to overcome it? Here's my code where I've replaced the sheet name and cell Range value: What am I doing wrong? const ss = SpreadsheetApp.getActiveSpreadsheet() const ws = ss.getSheetByName ('Ofuro Product Code Generator') function resetValues() const col2 = ws.getRange('B4').setValue('Select Tub Qty')
@LionelCOSTE2 ай бұрын
Amazing trick ! Thanks... Everyday you can learn something new...
@mart41442 ай бұрын
Good simple tutorial, thanks
@MrRBakhshi2 ай бұрын
suppose you made your original as a powerpoint presentation, it does happen, you know added the autodate to it already, and then converted it to slides, would the autodate operate in slides?
@bricehudson95413 ай бұрын
The sheets file is on the website. He stated this in the first few seconds of the video.
@CarlaArias-Chavez3 ай бұрын
Great formulas! I have a very similar sheet and was wondering if you had any advice on how to also calculate tardies with the timestamp?
@redtailfanschool2 ай бұрын
I guess if you are collecting the attendance in real time as students arrive, you could calculate a T if the timestamp was later than when they were supposed to check in. This formula would put a T if this time is after 8 am; =IF(TEXT(A2, "HH:MM") > TEXT(TIME(8, 0, 0), "HH:MM"), "T", "P")
@KaylaDarby-g7n3 ай бұрын
hello. do you have the formula posted anywhere? Cant read on the screen
@udayp16394 ай бұрын
Can you emulate a Subtotal function using query function?
@redtailfanschool4 ай бұрын
I am not sure what you mean? It seems to me that this is basically a subtotal function. Can you be more specific?
@thecaveofthedead9 күн бұрын
@@redtailfanschool this is a grand total. They're asking if you have a two layer categorisation - such as neckties | brand vs. coats | brand whether you can get a subtotal for neckties and coats the way that you can easily get from a pivot table as well as the grand total of both super categories.
@DUYENBAGWELL-e5c4 ай бұрын
What App Script do I change to allow for check-in and check-out from devices like cell phones or laptop. When checking in/out by other users but me (the owner of the spreadsheet), it does not show time out or in. It only shows the name. The time does not populate in. What am I doing wrong?
@redtailfanschool4 ай бұрын
Do you mean running this sheet from a phone instead of a computer? I have not tried that, but I am not sure it will work the same, which is what you are asking I guess
@ekelly8584 ай бұрын
Excellent! Thank you!
@AbdelrahmanHussein-u7i4 ай бұрын
Thank you, I was at a loss until I found this video.
@andersonmenezes63744 ай бұрын
I loved it. Congrats.
@simonjevans6155 ай бұрын
Thank you, very useful indeed!
@andikamaulana93145 ай бұрын
Thanks dude, there is tutorial validation ID number (have 5000 row unique ID number) on input google form? if they input ID number (correct), can input google form. Sorry my english bad.
@andersonmenezes63745 ай бұрын
I have a question. How can I do it with other pages for example 'sheet6' 'sheet7' 'shee8' in the same cell and column. col1 ('A2') for all the pages? by the way your videos are awesome. congratulations
@redtailfanschool4 ай бұрын
This will loop through all sheets and perform the function on all sheets if they are the same. If there are some sheets that are not set up this way, one would have to adjust the logic to not do the function on those sheets. function resetValues(){ const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheets = ss.getSheets(); sheets.forEach(sheet => { sheet.getRange('A2').setValue('All Ages'); sheet.getRange('B2').setValue('All Ages'); sheet.getRange('C2').setValue('All Genders'); sheet.getRange('D2').setValue('All Pain Type'); sheet.getRange('E2').setValue('All Resting BP'); sheet.getRange('F2').setValue('All Cholesterol'); sheet.getRange('G2').setValue('All Resting ECG'); sheet.getRange('H2').setValue('All Max HR'); sheet.getRange('I2').setValue('All Exercise Angina'); sheet.getRange('J2').setValue('All Oldpeak'); sheet.getRange('K2').setValue('All ST_Slope'); }); }
@andersonmenezes63744 ай бұрын
@@redtailfanschool Thanks a lot. You've helped, I need to learn how to use Apps Script.
@TilakConrad6 ай бұрын
very nicely done and explained perfectly - thank you very much and the best of luck with your excellent channel
@aelengelbert6 ай бұрын
Hola te sigo mucho y re agradezco todo lo que haces por la educación. Ojalá pudiera trabajar con usted pero vivo en Venezuela asi que como supondrá no hay recursos. Sin embargo agradezco cada video suyo éxito.
@salahuddinm066 ай бұрын
Thanks a lot for esiar way.
@ekelly8586 ай бұрын
This is awesome. Thank you!
@redtailfanschool6 ай бұрын
Glad you liked it!
@LucaRivoira896 ай бұрын
Hello, thank you so much for your perfect guide! I have a question, if you can help me. In my form, each answer of the multiple choice item has a "go to section" information, that is going to be lost after the form is updated. Is it possible to implement the script, by updating also the "go to section" information together with the anwers? For example "go to section" information could be stored near "Form List" column. Thank you in advance!
@TilakConrad7 ай бұрын
another superb tutorial - thanks very much - I follow you avidly 🙏 some feedback - not sure what happend to the video resolution on this.
@redtailfanschool6 ай бұрын
This was an older video I had made from back in 2017. So not using the same tools I currently use. Thank you for the feedback
@shawks767 ай бұрын
Great Tutorial. I'm getting a "document is inaccessible" error on this line: const copiedDocument = DocumentApp.openById(documentCopy.getId()); Any ideas? Thanks
@nancyacevedo29267 ай бұрын
This didn't work. The copy and Paste onto google slides. Is there a script in the Google slides? Also I don't see a link to the spreadsheet.
@sunshinetorres8767 ай бұрын
Hello! Would it be possible to have the ID code show at the end of the form after the submission of the form? Thank you!
@vietphulabel8 ай бұрын
I solved the error "Exceeded maximum execution time" by this code and over 4000 files in folder listed in 1s function onOpen() { var SS = SpreadsheetApp.getActiveSpreadsheet(); var ui = SpreadsheetApp.getUi(); ui.createMenu('List Files/Folders') .addItem('List All Files and Folders', 'getListFilesandFolders') .addToUi(); }; function getListFilesandFolders(){ Logger.log("getListFilesandFolders function started"); var folderId = Browser.inputBox('Enter folder ID', Browser.Buttons.OK_CANCEL); Logger.log("Folder ID entered: " + folderId); if (folderId === "") { Browser.msgBox('Folder ID is invalid'); return; } makeListFilesAndFolders(folderId, true); } function makeListFilesAndFolders(folderId, listAll) { Logger.log("makeListFilesAndFolders function started"); const sh = SpreadsheetApp.getActiveSheet(); const range = sh.getRange('A2:H'); range.clear(); sh.appendRow(["parent", "folder", "name", "date created", "date updated", "owner", "URL", "ID"]); try { const parentFolder = DriveApp.getFolderById(folderId); Logger.log("Parent Folder ID: " + folderId); Logger.log("Parent Folder Name: " + parentFolder.getName()); listFilesAndFolders(parentFolder, parentFolder.getName(), 0); } catch (e) { Logger.log("Error in makeListFilesAndFolders: " + e.toString()); } } function listFilesAndFolders(folder, parent, depth) { const sh = SpreadsheetApp.getActiveSheet(); const data = []; const files = folder.getFiles(); while (files.hasNext()) { const file = files.next(); data.push([parent, folder.getName(), file.getName(), file.getDateCreated(), file.getLastUpdated(), file.getOwner().getEmail(), file.getUrl(), file.getId()]); } if (data.length > 0) { sh.getRange(sh.getLastRow() + 1, 1, data.length, data[0].length).setValues(data); } if (depth < 3) { // Limit recursion depth to 3 levels const subFolders = folder.getFolders(); while (subFolders.hasNext()) { const subFolder = subFolders.next(); listFilesAndFolders(subFolder, parent + "|" + subFolder.getName(), depth + 1); } } }
@dankiet43978 ай бұрын
If I have a folder with many sheets, can I do this? Just textformat for 2 columns
@dankiet38388 ай бұрын
Can you make a tutorial on how to format multiple sheet files in a folder? For example, columns B-C will be Plain-text instead of automatic
@redtailfanschool8 ай бұрын
I am not clear what you mean by this?
@TheShadodragoon8 ай бұрын
Thank you! This is exactly what I was looking for. Keep up the good work!
@vietphulabel8 ай бұрын
Working well for me. Thank you!
@soundinducedflow8 ай бұрын
Exactly what I was looking to do (less the formatting which was just some unexpected icing on the cake!) Thanks, excellent explanation!
@redtailfanschool8 ай бұрын
Glad it was helpful!
@soundinducedflow6 ай бұрын
@@redtailfanschool Very much so. PS I did notice you create a const (source) but its never used.
@cristinapajarillo69569 ай бұрын
Hi! Thanks for sharing! What if I have multiple email addresses, and I’d want the email sent when a cell or column contains a specific text?
@redtailfanschool9 ай бұрын
Yes you can! in the email field add multiple email addresses separated by commas. And I think in the script we would set it up to look for a specific text. I would have to try this to see.
You seem super knowledgeable about this topic. I need some help...We are trying to collect information on each student every day whether or not they took and ate a school breakfast and/or lunch. I created 23 different teacher forms in which the data is being dropped into a single spreadsheet. I'm using COUNTIFS to tally. The problem I'm having is that the form is not calculating in real-time or my formulas are incorrect because I'm new at this. I was wondering if you'd be able to help me?
@redtailfanschool9 ай бұрын
Surely, I would be glad to help you with this project. Sorry for the late reply, I have been out of the country. Send me an email at [email protected]
@mrkhalidhafeth58239 ай бұрын
very good script
@FrankT-sz2cu9 ай бұрын
I tried the script and it also works on shared folders. But I have a problem due to the large number of files in the folders - about 6 minutes after startup, a notification about the maximum time exceeded appears. Is it possible to amend the script so that on restart it continues where it left off in the previous attempt?
@salcoliz10 ай бұрын
Hey there, do you need to be the owner of the folder for the script to work? Thanks!
@Ruzhylkin10 ай бұрын
Hello. How can this script be extended to rename files in the newly created folder? For instance to get a name structure like <student name> + <file name> Thanks.
@richardwhalen185910 ай бұрын
Thanks so much - This solved an issue for me
@aryanjha873210 ай бұрын
can we do this on a third party g drive link shared with us thanks in advance
@dwccrook6210 ай бұрын
I am trying to script using your "Use Apps Script to send a Form email to different email addresses based on a form question" video. in the for loop, I get a undefined "values" error. Does a person enter this App Scripts EXACTLY as you have it? I am new to this.
@redtailfanschool9 ай бұрын
So that depends on whether your sheets have the data in the exact same columns as I have. If not the script may need some modifications
@BenPomeroy-q6x10 ай бұрын
Thanks
@michaelreeder310611 ай бұрын
Thank you for the video. You explained it brilliantly.
@fyrman909211 ай бұрын
I was expecting something more complex, but your simple script was the answer to my problem. Nice Job!
@redtailfanschool11 ай бұрын
Glad it helped!
@vinayhompath211 ай бұрын
thank you so much, you saved me hours of time adding links to my flie names in excel 🙏