How to Get The Last Row - Google Sheets Apps Scripts - Array Methods Part 10

  Рет қаралды 63,943

Learn Google Sheets & Excel Spreadsheets

Learn Google Sheets & Excel Spreadsheets

Күн бұрын

In this tutorial learn how to get the last row of data in Google Sheets using Apps Script. We'll go over several methods of getting the last row, including array version using .every() array method in JavaScript.
Array Methods Series Part 10
#javascript #appsscript

Пікірлер: 54
@PawelGrabiec
@PawelGrabiec 2 жыл бұрын
Great guide. But one question - should overwrite the existing function names? Like getLastRow?
@dwaynedsouza
@dwaynedsouza Жыл бұрын
Hi, so when I tried to get the last row, along with adding multiple data separate rows and columns (leaving a few blank columns in between), it skipped blanked rows and when to the last row that had data. I did the following; function myFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var lr = ss.getLastRow(); Logger.log(lr); } And it somehow gave the last row (skipping blank rows in between).
@SPA_developer
@SPA_developer 5 жыл бұрын
The best explanations google tables! Keep up the good work!
@haihuynhthanh3078
@haihuynhthanh3078 2 жыл бұрын
Thanks very much. A teacher is really great!
@ExcelGoogleSheets
@ExcelGoogleSheets 2 жыл бұрын
Thank you! 😃
@testaccount6075
@testaccount6075 3 жыл бұрын
Thank you so, so much for this intermediate series!
@oxpey4473
@oxpey4473 2 жыл бұрын
Doesnt work for me, it said "Cant getRange property of undefined.
@tuberats99
@tuberats99 3 жыл бұрын
just what a novice needs :)
@RoseLK
@RoseLK 4 жыл бұрын
It works for me. Thank you so much for the lessons!
@pichit.raetai
@pichit.raetai 4 жыл бұрын
Thank you, you are my teacher.
@carmencastro5512
@carmencastro5512 5 жыл бұрын
mil gracias, buen video, buena explicacion, sigue haciendo videos asi.......
@SilverfoxTOAO
@SilverfoxTOAO 5 жыл бұрын
Why not set lrIndex inside your if statement? Why set it on every iteration of the for loop? You already have i tracking. Just set it when you find what you're looking for. Or am I missing something?
@vanessagarcia5258
@vanessagarcia5258 Жыл бұрын
Super helpfull...Tysm!!!
@ExcelGoogleSheets
@ExcelGoogleSheets Жыл бұрын
👍
@tonmoyahmed1985
@tonmoyahmed1985 4 жыл бұрын
wow! it's very helpful, Thank you
@yasmeenkarachiwala3766
@yasmeenkarachiwala3766 2 жыл бұрын
Hello Sir, Thank you so much for the great content. I want to create an audit function to pick up random rows based on certain criteria. Could you please provide some help? Thank you!
@nhule8442
@nhule8442 2 жыл бұрын
Fantastic thanks ☺️
@jaesonboque3888
@jaesonboque3888 4 жыл бұрын
This helps alot wow
@Blackdocks
@Blackdocks 4 жыл бұрын
THANK YOU !
@securecircle4031
@securecircle4031 Жыл бұрын
I have a result set that I push in one array and I want to paste it from the last blank row. Do you have any method using appscript to obtain the last blank row and paste all my array from this blank row? I want to paste all array instead of row by row in spreadsheet. Thanks!
@dohatransmission4760
@dohatransmission4760 2 жыл бұрын
Hi there you have so much content on KZbin I'm having trouble finding the videos in the right order, have you? or can you ? put up a playlist somewhere of all the videos in the correct order? It would be much appreciated as I go through them all. Many thanks and tanks again for all this work it's really a fantastic resource.
@ExcelGoogleSheets
@ExcelGoogleSheets 2 жыл бұрын
It's already done here kzbin.infoplaylists
@bulbulahmed3098
@bulbulahmed3098 11 ай бұрын
❤❤❤❤
@Adanknaw
@Adanknaw 2 жыл бұрын
Thank you bro
@patrickm9953
@patrickm9953 4 жыл бұрын
Great job, easy to follow guide.. I was just wondering how to do this. Thx
@kachler67
@kachler67 Жыл бұрын
Very nice tutorial, thanks mate. So I'm trying to create a button, that sets the next checkbox (they are in G11:G and auto timestamp with your onEdit(e) approach in H11:H) right after the last row to TRUE when pressed, so that I have a "LOG IN" button at the top without the need of scrolling down and toggling the respective box myself. How can I use the "lr" variable to set the value, can you help me on that one maybe?
@wilbertsembiring2209
@wilbertsembiring2209 5 жыл бұрын
Hi, can you help me for this : No logs found. Use Logger API to add logs to your project. Thank you before..
@paulloup5210
@paulloup5210 5 жыл бұрын
Thank you very much !
@ZX-uh2mw
@ZX-uh2mw 5 жыл бұрын
quick question: how do you create a script to delete the last row? similar to this script: function row() { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.getRange('3:3').activate(); spreadsheet.getActiveSheet().deleteRows(spreadsheet.getActiveRange().getRow(), spreadsheet.getActiveRange().getNumRows()); };
@emersonpan
@emersonpan 2 жыл бұрын
I might encounter a tiny bug. If the last row is 0. Then the every(function(c){ return c == ""; }) would return true instead of false. But every(function(c){ return c === ""; }) fix it.
@ExcelGoogleSheets
@ExcelGoogleSheets 2 жыл бұрын
good catch!
@emersonpan
@emersonpan 2 жыл бұрын
Good tutorial~ thank you for the great work.
@eiger67
@eiger67 5 жыл бұрын
Thank you for this
@jaedonbigbrain8700
@jaedonbigbrain8700 3 жыл бұрын
how can i do to send data from one spread sheet to another spread sheet please
@marcelcharest7662
@marcelcharest7662 5 жыл бұрын
Merci!
@phoenixempire8886
@phoenixempire8886 4 жыл бұрын
🙏🏻
@strativaryus
@strativaryus 5 жыл бұрын
Thanks for sharing. Great content as usual! Could you give us a light, please? I explain my point bellow. That method is witchy... I'm not as much familiar to JS as I should be, I guess... At 18:30, you take all 5 first columns in a range (rng = "A1:E"), than you feed one line at a time doing 'row = rng[i]'. Later, you instruct that every cell in that row should run a function that returns a logical result, testing its content against null (""). So, every cell is going to test equality to 'null' and the variable receives them all, actually as an array containing TRUEs and FALSEs, five of them at most. Is that right? In the most common situation, we have 'row=[,,,,]' -- so we get 'isBlank=[TRUE,TRUE,TRUE,TRUE,TRUE]' But when 'row=[,,blah,,] -- we instead get 'isBlank=[TRUE,TRUE,FALSE,TRUE,TRUE]'. Listen, Your code is not ANDing all those cells, even though a simple 'if(!isBlank)' does the magic!! Why is that??! Dawn, I hate those smoothly typeless languages... Can you provide a documentation where I can read all those implicit routines in JS, please?
@ExcelGoogleSheets
@ExcelGoogleSheets 5 жыл бұрын
isBlank is not an array, it's just one value, true or false. Watch this video to understand how every method works kzbin.info/www/bejne/nZKmY2xmjd-DjpY
@ExcelGoogleSheets
@ExcelGoogleSheets 5 жыл бұрын
Also !true will make it false, !false will make it true. Just watch the video I linked, I cover all of that.
@strativaryus
@strativaryus 5 жыл бұрын
That makes it clear! Wow, you already get it in another video. I'm sorry for my lack of attention. I should watch all your videos before asking. Good job!
@Dfjjiii8btrdcvvbbhhhhhhhhh
@Dfjjiii8btrdcvvbbhhhhhhhhh Жыл бұрын
How to get headers or first row?
@khemrajrana7322
@khemrajrana7322 5 жыл бұрын
Nice sir but sir how to selected all column in one time in Google sheet plz rply
@ExcelGoogleSheets
@ExcelGoogleSheets 5 жыл бұрын
Unfortunately, I'm not sure what you're asking.
@khemrajrana7322
@khemrajrana7322 5 жыл бұрын
Sir how to Selected All column Name range one time in Google sheet
@elabinnovations
@elabinnovations 5 жыл бұрын
*Thank you sir* How to get last row into JSON map format?
@ExcelGoogleSheets
@ExcelGoogleSheets 5 жыл бұрын
You would have to grab the labels row and your last row, then loop through it to make a JavaScript object, then JSON stringify it.
@elabinnovations
@elabinnovations 5 жыл бұрын
@@ExcelGoogleSheets any video tutorial?
@elabinnovations
@elabinnovations 5 жыл бұрын
@@ExcelGoogleSheets Can you make a video?
@Tom-fm2us
@Tom-fm2us 5 жыл бұрын
No logs found. Use Logger API???? Documentation does not match my experience.
@Malally2
@Malally2 2 жыл бұрын
its telling me "getlastrow is not defined" ........
@ExcelGoogleSheets
@ExcelGoogleSheets 2 жыл бұрын
CaseSensitive
Google Forms - Drop Down List from Spreadsheet Using Apps Script
34:39
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 443 М.
PDFs from Spreadsheet Data and Google Docs Template - Google Sheets
32:38
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 220 М.
LIFEHACK😳 Rate our backpacks 1-10 😜🔥🎒
00:13
Diana Belitskay
Рет қаралды 3,7 МЛН
SHAPALAQ 6 серия / 3 часть #aminkavitaminka #aminak #aminokka #расулшоу
00:59
Аминка Витаминка
Рет қаралды 1,3 МЛН
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 16 МЛН
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 997 М.
Google Sheets Web App Example - Google Apps Script Web App Tutorial - Part 1
31:41
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 796 М.
JavaScript Filter Method Tutorial - Google Sheets Apps Scripts - Array Methods Part 7
27:19
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 71 М.
Google Apps Script - Google Drive Tutorial, Files, Folders, Copy Files, DriveApp, Iterator - Part 15
29:31
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 131 М.
JavaScript 2 Dimensional Arrays, Reading & Writing Array To and From  Ranges - Part 2 -  Apps Script
22:28
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 52 М.
JavaScript indexOf, lastIndexOf Methods Tutorial - Google Sheets Apps Scripts - Array Methods Part 6
20:31
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 32 М.
How to Copy a Row to another Sheet with Google Apps Script
15:18
Google Sheets onEdit Trigger - Automatically Drag Down Formulas - Apps Script
25:03
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 86 М.
Google Sheets - Send Emails Using Apps Script JavaScript MailApp Tutorial - Part 12
36:10
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 246 М.
LIFEHACK😳 Rate our backpacks 1-10 😜🔥🎒
00:13
Diana Belitskay
Рет қаралды 3,7 МЛН