Hi James, if i update a cell, will it show in edit history of the individual cell? I'm looking for a way to edit a cell without it showing in the edit history.
Thanks a lot man, you saved me here, I was requested to do a simple database using sheets API but the google documentation is awful,your explanation is very good, congrats!
Thank you for making this. My website was using v3 and it just got deprecated this month and I was totally lost with how to read a google sheet with the v4 api. This was a life saver. Thank you!
Thanks for sharing. I was thinking about doing this for my mailing list, where spinning up a PostgreSQL database just for this seemed overkill. I didn't expect it to be this involved, so I'm really glad you put this together.
Thanks for the great explanation, quick note: you don't need to use auth in the options every time you are using googleSheets, because you already pass it in the start (when you set google sheet version and auth)
Oh thank you, man 🙏 I've been trying to do a similar thing for three days, almost gave up and tried googling for such a video, and there you, thanks again 💪
Great tutorial, thanks ! Worth mentioning : googleapis ONLY works on the server side. This will not work in a client side application like React or Vue alone.
I have been looking for a tutorial on how to do this for a couple months. This is the best-explained one I have come across. Thank you! I have now subscribed :)
Thank you, you are a savior. I was given a test related to google sheet connector for my first dev role interview process and successfully completed because of you. Thanks a lot for creating this.
Thanks for the tutorial, James. There isn't a lot of solid tutorial content surrounding the Sheets API and Node.js but yours is spot on. Do you have the link to your blog in which you take a deeper dive into working with Google Sheets API? Also - ever think about teaching a Udemy course on the subject?
Thank you for this great content. Unfortunately I'm experiencing difficulties implementing this. I have a basic form set up with react and nodemailer which works fine but sending the data to Google sheets returned an error: invalid credentials. Pls how do I fix this
Quite a handful of instructions. I think is a lot easier to just create a google app script to handle the CRUD operations on google sheets. That way you only need the deployment url in your nodejs to initiate reads and writes. Thanks though, it was very informative!
First of all, thank you for your video, it helped me alot! Sadly I have an issue with my authentification. When I try to start the server/ refresh the server at the point of minute 13 and reload the Website in my browser, the site can not load. In VS Code I get an error. message: ‘Invalid Credentials’, domain: ‘global’, reason: ‘authError’, location: ‘Authorization’, locationType: ‘header’ Unfortunately I have no clue where and what went wrong. My Code looks identical. Maybe you or some else can help me out. Thank you in advance! And greetings from germany Malte
You helped me a lot. Thx Little question, I just created a new google spread sheet. I received my 200, but it seems that only the "account service" from the api key has an access to it. Which is weird because my main account is responsible of the account service. Any idea ?
For those who wonder the same question : you need to use the GDrive Api. After creating the file with account service, you need to use : developers.google.com/drive/api/v3/reference/permissions/create ``` const result = await googleSheets.spreadsheets.create(params); const fileId = result.data.spreadsheetId; drive = google.drive({ version: "v3", auth }); const res = await drive.permissions.create({ resource: { type: "user", //role: "owner", role: "writer", emailAddress: "xxxx" // Set the email address you want to give the permission. }, fileId: fileId, fields: "id", //transferOwnership: true, }); ``` Still have an issue with ownership that i need to fix with the above code : Consent is required to transfer ownership of a file to another user.
That’s a great tutorial regarding Google Sheets API. Your explanation is decent and very detailed. Could you make a video how to sync Google sheets with Next.js?
Thanks a lot! This seems like exactly what I've been trying to make. Just trying to figure out how to make it work on a website next. I guess at least I have to secure the credentials file somehow...
thank you. there should be a free no-code app to recreate this particular scenario. Custo form submitted to google sheets and read from google sheets a render as HTML.. this would cover 90% of every small business needs.
Real nice and concise tutorial! Thanks man. I was wondering however; how it is possible to make this more modular and make the spreadsheetId dependant on the user input - which ofcourse brings us to the following point; having the right read/write permissions on the spreadsheet.
Great tutorial, thank you! I’m wondering how to handle credentials.json? I guess you won’t commit it to the git so how would you provide this file for a deployment eg Heroku?
Hi James, This was really helpful. there is such limited resources for the Google Sheet Integration and most of time I get a road block after following some. but with this tutorial, you were able to explain things in a easy to understand manner. Could you do a CRUD Html table example for this?
hey james...Thanks for the video but what if iam creating the spread sheet through a api call and i need to grand the permission for the service account. For me it is not possible to share the permission manually cause im creating the spread sheet through api call itself
Awesome. Thanks a lot. I have a question. If I have to update a specific row, would I have to read the entire sheet to then know the position of the row that I have to update? or is there some other way?
Well in order to update a specific row, you will need to know the row number, which you can then specify as part of the range, using the "update" function rather than append, which works in the same way but the function is called update rather than append. For example, if the row you want to update is row 7, you would use append like in the video but set the range as "Sheet1!A7:B7", or whatever column range you want to use (B7:C7 or A7:D7, etc.) Hope this helps, thanks for watching!
Hi! Great video. It worked for me. I have a question tho. The read of the csv WORKS just if I have a csv with just 1 sheet. I have another with 3 sheets and when i Try to get the values says errors: [ { message: 'This operation is not supported for this document', domain: 'global', reason: 'failedPrecondition' } ] what could it be?
Hello! So I am trying to make it so that this specific index.js file that handles the sending of data to the google sheets, is called by another normal .js file question is, how I will pass data to it and have it get triggered by a specific event, to go an append the data, to my google sheets? without using the .ejs button that you have created
@James I want to append a json object with it's values to google sheet using append. How can I do that? The rest is working fine. The only issue is I want to pass the json values be pasted in seperate columns, right now whole json object is being written to only one row as a whole.
Was hoping this would be on the google-spreadsheet npm module, but to achieve your original goal you could have created a Google form and have the results appear in a sheet.
This is too much power... really well done video! No complaints here, everything worked as you described, but maybe if you elaborated on more than just appending / reading, that would've been nice.
Thanks so much for the kind words! In hindsight, I wish I had spent more time on the actual Google Sheets API rather than the demo application - I wanted to keep the video as short as possible, so I only demonstrated the features I actually found useful in the API. I am going to write a blog post on this soon, and will make sure it demonstrates more capabilities of the API!
When I run i in my local machine it's working well, but i sent it to git hub and published with github pages. But it isn't working online, I don't know why. The pages redirect to an error: 405 Not Allowed And I receive a console error that says. POST ... 405
Hello. I want to congratulate you for showing this content, I followed all the steps in this video, and everything works fine, only my form is bigger and it gives me an error when saving, it only saves one field, the rest does not save, it has an email where i can write you and share the code
The metaData variable isn't working for me. I think it is to do with the spreadsheet Id but I have already given the bot access to the spreadsheet so I am not sure what's up with it
Hi There, great tutorial first of all. However when i try to hit the api from client side, i get cors error. I have put below in nodejs api which you have provided" app.use((req, res, next) => { res.setHeader("Access-Control-Allow-Origin", "*"); res.header( "Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept" ); next(); }); still i get cors. what will be the solution for this?
Building something at the moment where I need to read from a Google Sheet... I'm back here reminding myself how to do it 😂
Hi James, if i update a cell, will it show in edit history of the individual cell? I'm looking for a way to edit a cell without it showing in the edit history.
🤣
Thanks a lot man, you saved me here, I was requested to do a simple database using sheets API but the google documentation is awful,your explanation is very good, congrats!
Appreciate you watching! :)
THANK YOU ... FINALLY, SOMEONE SPEAKING CLEAR ENGLISH HAS MADE A TUTORIAL ON THIS TOPIC THAT TRULY HELPS ... THANK YOU !!
Thank you for making this. My website was using v3 and it just got deprecated this month and I was totally lost with how to read a google sheet with the v4 api. This was a life saver. Thank you!
Thanks for sharing. I was thinking about doing this for my mailing list, where spinning up a PostgreSQL database just for this seemed overkill. I didn't expect it to be this involved, so I'm really glad you put this together.
Thanks for the great explanation, quick note:
you don't need to use auth in the options every time you are using googleSheets, because you already pass it in the start (when you set google sheet version and auth)
Great point :)
I tried some tutorial on the internet and fail. Then I find yours :). Thank you so much!
Oh thank you, man 🙏
I've been trying to do a similar thing for three days, almost gave up and tried googling for such a video, and there you, thanks again 💪
Thank you for such a great, crisp tutorial. This should be the goto place instead of the docs.
Great tutorial, thanks !
Worth mentioning : googleapis ONLY works on the server side. This will not work in a client side application like React or Vue alone.
I have been looking for a tutorial on how to do this for a couple months. This is the best-explained one I have come across. Thank you! I have now subscribed :)
Wow thanks so much! More videos coming soon :)
Thank you, you are a savior. I was given a test related to google sheet connector for my first dev role interview process and successfully completed because of you. Thanks a lot for creating this.
bruh... literally what I was looking for. Thank you for making this complicated subject easy to understand.
Awesome video! Sad to see that you stopped making more videos.
You made this and the website it is about and haven't made a video since 😞...... you are a good teacher...
Thanks for this! I was bouncing around reading the docs for way too long!
This was exactly what I needed Lol Thank you so much!! Great video!!
So glad you found it useful! :)
Thanks for the tutorial, James. There isn't a lot of solid tutorial content surrounding the Sheets API and Node.js but yours is spot on. Do you have the link to your blog in which you take a deeper dive into working with Google Sheets API? Also - ever think about teaching a Udemy course on the subject?
I never got around to writing a blog post on this! I want to make more videos and maybe courses in the future though
Thank you for this great content. Unfortunately I'm experiencing difficulties implementing this. I have a basic form set up with react and nodemailer which works fine but sending the data to Google sheets returned an error: invalid credentials. Pls how do I fix this
Thank you so much for this tutorial.
it's perfect for me because I'm working with express and google sheets API.
Clean, Clear, and Concise. Bravo!
You are awesome. This was just what I was looking for!
Good video, I was reading the Google Sheet API and I don't undertand but I can
best explanation I've ever seen
Quite a handful of instructions. I think is a lot easier to just create a google app script to handle the CRUD operations on google sheets. That way you only need the deployment url in your nodejs to initiate reads and writes.
Thanks though, it was very informative!
This is great, James, it served me perfectly. Thank you.
First of all, thank you for your video, it helped me alot!
Sadly I have an issue with my authentification. When I try to start the server/ refresh the server at the point of minute 13 and reload the Website in my browser, the site can not load. In VS Code I get an error.
message: ‘Invalid Credentials’,
domain: ‘global’,
reason: ‘authError’,
location: ‘Authorization’,
locationType: ‘header’
Unfortunately I have no clue where and what went wrong. My Code looks identical. Maybe you or some else can help me out.
Thank you in advance!
And greetings from germany
Malte
Great tutorial on working with Google sheet api , that is get starter for everyone. Thnx
You helped me a lot. Thx
Little question, I just created a new google spread sheet.
I received my 200, but it seems that only the "account service" from the api key has an access to it. Which is weird because my main account is responsible of the account service. Any idea ?
For those who wonder the same question : you need to use the GDrive Api. After creating the file with account service, you need to use : developers.google.com/drive/api/v3/reference/permissions/create
```
const result = await googleSheets.spreadsheets.create(params);
const fileId = result.data.spreadsheetId;
drive = google.drive({ version: "v3", auth });
const res = await drive.permissions.create({
resource: {
type: "user",
//role: "owner",
role: "writer",
emailAddress: "xxxx" // Set the email address you want to give the permission.
},
fileId: fileId,
fields: "id",
//transferOwnership: true,
});
```
Still have an issue with ownership that i need to fix with the above code : Consent is required to transfer ownership of a file to another user.
u save my day!! that a really wonderful tutorial
great video and content. love the teaching style keep the good work up man.
That’s a great tutorial regarding Google Sheets API. Your explanation is decent and very detailed. Could you make a video how to sync Google sheets with Next.js?
Simple to the point...
Do you have any tutorial on google fit api?...
This is so great. Thank you.
As long as I know adding Reactjs to this should not be a big deal isn't it?
Convert the node.js app to an API, and then use fetch calls to integrate with a React.js app. Should be straightforward :)
Thanks a lot!
This seems like exactly what I've been trying to make.
Just trying to figure out how to make it work on a website next.
I guess at least I have to secure the credentials file somehow...
8:15 when i do "nodemon index.js" it tells me that "nodemon" is an unknown command, even though i installed the package. what's going on?
This is a very very beautiful tutorial! Very detailed… 🙏🏽
Great video, thanks for making this so simp😀le compared to most other videos available on RUclips 👍
One tip for you, since you share tips with us :-) npm init -y will initialize project folder with default values for you
Great tip!
Great explanation, pretty much got all i need to know. Thanks :)
thnks a lot, this video is really helpful.
Thanks for this great tutorial, James.
Very good video clear and sharp! A little question though , any idea how to delete a row with the API ? Thanks in advance.
Just found out the channel, thank you keep it brother great content and flow cheers
THANK YOU VEEEERRRRYYY MUCH. you are the best. i am so glad i found this vid
Thank you, the tutorial is nicely done. :D
Thanks Sir, Really helpful and the way explained is awsome.
Neat idea! Imma take some notes 📖
So cool isn’t it!!
thank you. there should be a free no-code app to recreate this particular scenario. Custo form submitted to google sheets and read from google sheets a render as HTML.. this would cover 90% of every small business needs.
Real nice and concise tutorial! Thanks man.
I was wondering however; how it is possible to make this more modular and make the spreadsheetId dependant on the user input - which ofcourse brings us to the following point; having the right read/write permissions on the spreadsheet.
yes check alternative video from neuralnine but in python
This video is exactly what I needed, thaks )
Hey man! Insane tutorial thanks you ! Same a lot of time
Thanks for the video @James
Can I get the details about integrating the same from react ?
I wonder when you deploy your app. So other users can have the right to write into google sheet ?. Thanks
Nice Video! Please tell me, how i can read the values in sheets and use with aplications to for example show in div?
Thank you! Very helpful and informative.
Dotenv module will be helpful to hide credentials details.
Very Helpful... Thanks for sharing
how to do that?
Beautifully Explained!! Thanks
Great tutorial, thank you! I’m wondering how to handle credentials.json? I guess you won’t commit it to the git so how would you provide this file for a deployment eg Heroku?
Hi, I know it was a long time ago, but... Is it free for commercial usage?
producer's version? I just want to make sure I get the right one for .
gj creating a video on this. you saved me some time. ty sir
Appreciate you watching! :)
Thank you. Wish you would have explained Express
I really like your vscode setup. How did you get the arrow shape on your terminal ?
My terminal is like that because of something called ohmyzsh. I think the plugin was called Powerlevel10k
Hi James,
This was really helpful. there is such limited resources for the Google Sheet Integration and most of time I get a road block after following some.
but with this tutorial, you were able to explain things in a easy to understand manner.
Could you do a CRUD Html table example for this?
yes we need this
hey james...Thanks for the video but what if iam creating the spread sheet through a api call and i need to grand the permission for the service account. For me it is not possible to share the permission manually cause im creating the spread sheet through api call itself
This actually saved me. Thanks bor.
Another question about namedrange, they are listed in your Metadata variable but how to create a new one from the API ?
I only have ones question how to install googleapis on server ? is there are import link or something to import on index.html ?
Awesome. Thanks a lot.
I have a question.
If I have to update a specific row, would I have to read the entire sheet to then know the position of the row that I have to update? or is there some other way?
Well in order to update a specific row, you will need to know the row number, which you can then specify as part of the range, using the "update" function rather than append, which works in the same way but the function is called update rather than append. For example, if the row you want to update is row 7, you would use append like in the video but set the range as "Sheet1!A7:B7", or whatever column range you want to use (B7:C7 or A7:D7, etc.)
Hope this helps, thanks for watching!
please make something about passport js ur explanation is really top notch
The next series will be an authentication series!
Hi! Great video. It worked for me. I have a question tho.
The read of the csv WORKS just if I have a csv with just 1 sheet.
I have another with 3 sheets and when i Try to get the values says
errors: [
{
message: 'This operation is not supported for this document',
domain: 'global',
reason: 'failedPrecondition'
}
]
what could it be?
Nevermind. I diplucated the file, get that id and work. Weird tho
рахмет, Жеміс
Is there any way to read from a spreadsheet and use the data on the spreadsheet to input information on fields on a website to automate boring work?
Wow, thanks for the tutorial!
Hello! So I am trying to make it so that this specific index.js file that handles the sending of data to the google sheets, is called by another normal .js file
question is, how I will pass data to it and have it get triggered by a specific event, to go an append the data, to my google sheets? without using the .ejs button that you have created
Perfect, you saved me. THANK YOU
@James I want to append a json object with it's values to google sheet using append. How can I do that? The rest is working fine. The only issue is I want to pass the json values be pasted in seperate columns, right now whole json object is being written to only one row as a whole.
Very good tutorial! Thank you.
Thank you for the great explanation.
How can i do the same using Javascript?
I’m working on a chrome extension and node js is a bit tricky there
Have you ever figured this out?
Was hoping this would be on the google-spreadsheet npm module, but to achieve your original goal you could have created a Google form and have the results appear in a sheet.
Very true, but I wanted to mess around with the API directly for more complex use cases in the future. Form was just a good starter example
Best video. Working very well for me
thank you so much. it's very helpful
This is too much power... really well done video! No complaints here, everything worked as you described, but maybe if you elaborated on more than just appending / reading, that would've been nice.
Thanks so much for the kind words! In hindsight, I wish I had spent more time on the actual Google Sheets API rather than the demo application - I wanted to keep the video as short as possible, so I only demonstrated the features I actually found useful in the API. I am going to write a blog post on this soon, and will make sure it demonstrates more capabilities of the API!
Hello, how can you make a FOR loop with 2 columns, for example phone number and message to send?
Thanks! Awesome explanation!
How would I go about deleting the second row and moving every row below it up? Is that feasible?
Bro I am Missing your videos, I subscribed you with hope
Thanks for the tutorial!
How should we hide the credentials while also serving them to the nodejs file?
by using .env ruclips.net/video/5WFyhsnU4Ik/видео.html&ab_channel=SteveGriffith-Prof3ssorSt3v3
Thanks a lot! Great video
Isn't keeping the credentials.json in the code base not a good practice. Is there an alternative way of authenticating?
Thaank you sooo much!!
Can we upload files on Google sheet from registation form when user upload it
When I run i in my local machine it's working well, but i sent it to git hub and published with github pages. But it isn't working online, I don't know why. The pages redirect to an error: 405 Not Allowed
And I receive a console error that says.
POST ... 405
hey mate... i was trying to create an app to allow users to edit their sheets itslef. how can i do that?
Hello. I want to congratulate you for showing this content, I followed all the steps in this video, and everything works fine, only my form is bigger and it gives me an error when saving, it only saves one field, the rest does not save, it has an email where i can write you and share the code
Did you figure out your problem yet?
The metaData variable isn't working for me. I think it is to do with the spreadsheet Id but I have already given the bot access to the spreadsheet so I am not sure what's up with it
Thank You! Great job!
can be all new column and update the entere value later?
Hi There, great tutorial first of all.
However when i try to hit the api from client side, i get cors error.
I have put below in nodejs api which you have provided"
app.use((req, res, next) => {
res.setHeader("Access-Control-Allow-Origin", "*");
res.header(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept"
);
next();
});
still i get cors.
what will be the solution for this?
use a package called cors
npm install cors
And in your codebase,
const cors = require("cors")
app.use(cors())