Use ChatGPT in Google Apps Script

  Рет қаралды 18,567

Ben Ronkin

Ben Ronkin

Жыл бұрын

Learn how to pull data out of Google Sheet, convert it into a prompt, send the prompt to the ChatGPT API, get a response back, and store the response in a Google Doc - all while using Google Apps Script.
Blog post: benronkin.com/blog/use-chatgp...

Пікірлер: 50
@MarioCapellari
@MarioCapellari 3 ай бұрын
Nice! One of the best AppsScript demos. Nice job!
@benronkin
@benronkin 2 ай бұрын
Thanks! 😃
@smfsaa
@smfsaa 8 ай бұрын
Thank you so much! This was so valuable.
@zekeluther
@zekeluther Жыл бұрын
Subscribed, value added content 💯
@benronkin
@benronkin Жыл бұрын
Thank you. I really appreciate it.
@jayasri-ft8040
@jayasri-ft8040 Жыл бұрын
Mind blowing. Thankyou
@benronkin
@benronkin Жыл бұрын
I appreciate the feedback; thank you!
@Blacklotus63
@Blacklotus63 6 ай бұрын
Have you ever gotten this error? error: { "message": "Incorrect API key provided: undefined. I have triple-checked that my API key is correct and I even created new keys to test it, yet I continue getting this error message.
@EmanFoghis
@EmanFoghis Жыл бұрын
When you mean removing header and data splice at 14.49, is that the "Summary"? Trying to understand since my file has like 5 rows I do not need, so not sure if you removed first column, or first row or both?
@benronkin
@benronkin Жыл бұрын
No, it's the first row that contains the headers, which we don't need to send to ChatGPT. So in your case you'll do .splice(0,6).
@gabrielcarulla6951
@gabrielcarulla6951 Жыл бұрын
Hey, thanks for the class, loved the way you approached it, great didatics! I did the whole process but, when I hit run, instead of receiving the text generated in the console.log I get an Error of invalid API Key, even though I double checked the API key and the property details and it is accurate. Note that the error I'm getting is not the one we've thrown on the code, which would be for a 'missing API key', but I guess it's something related to the scriptProps, any ideas on what should I try?
@benronkin
@benronkin Жыл бұрын
Is the Error coming from the OpenAI server? If so then you probably are not using the token they give you, or you are not passing it correctly in the Authorization header. Can you check?
@gabrielcarulla6951
@gabrielcarulla6951 Жыл бұрын
@@benronkin it went well, in the end the problem was a missing semicolon lol
@chalger
@chalger Жыл бұрын
How do you push it o to the AAppsScript IDE? Have you got some kind of keyboard shortcuts for clasp?
@benronkin
@benronkin Жыл бұрын
You can use npx clasp push -w which will automatically push to the IDE any time you save your file changes.
@AmineBELALIA
@AmineBELALIA Жыл бұрын
great work , really mazing
@benronkin
@benronkin Жыл бұрын
I'm happy that you found it useful. Let me know what other tutorials you'd like to see.
@EmmanuelEto-Abasi-ft2fr
@EmmanuelEto-Abasi-ft2fr Жыл бұрын
Great work!!!👍 Please how do I implement access control to the app script and keep some users from accessing the script details. Thanks
@benronkin
@benronkin Жыл бұрын
You can share the Apps Script file with specific people, just like you can do with Google Docs, Sheets, etc.
@nancybella7474
@nancybella7474 3 ай бұрын
Could you produce a tutorial video demonstrating how to automate the creation of PDF salary slips for employees using Google Sheets and Apps Script? I lack coding skills, so could the script be designed to instruct ChatGPT to generate the slips? Additionally, it would be beneficial if employees could conveniently access their monthly salary online. Thank you 🙏😊
@indianguy6683
@indianguy6683 Жыл бұрын
Can you create a program like calling openai inside google data studio (data looker) and analyse the search console traffic for seo purposes? I think we will need appscript for that but I don’t understand how I will send data of search console from google data looker to openai to get response
@benronkin
@benronkin Жыл бұрын
You could use the example of my google apps script to save the openai responses in a google sheet, and then you can import the sheet into data studio for analysis.
@indianguy6683
@indianguy6683 Жыл бұрын
@@benronkin I got your point but how I will send search console data to the API so I will get desired response from it. I want to send data from google data studio (looker)
@benronkin
@benronkin Жыл бұрын
@@indianguy6683 I see your point. Give me an example of a ChatGPT prompt that will include search console data.
@indianguy6683
@indianguy6683 Жыл бұрын
@@benronkin ok I have done some research on it. Search console provides data in json format so the prompt will be like - I am sharing google search console data with you and need to analyse it for seo purposes and provide me best suggestions in easy to understand way. {{ paste GSC data in json format here }} I have tested this prompt in chatGPT it works. Someone can write more customised prompt.
@benronkin
@benronkin Жыл бұрын
@@indianguy6683 Ok. I'll investigate and create a video tutorial on this topic. I hope to publish it tomorrow on the following day.
@bengreeley5681
@bengreeley5681 Жыл бұрын
How do I turn this into an add on for the extension marketplace
@benronkin
@benronkin Жыл бұрын
It's a quite involved process. I'll add that tutorial idea to my list. Thanks.
@user-tu4jb6wx2c
@user-tu4jb6wx2c Жыл бұрын
This is amazing and just what I am looking for. Is there access to the code where I can enter my own credentials to make the magic happen on my end?
@benronkin
@benronkin Жыл бұрын
You can copy the code from my blog onto your own Google Workspace environment: benronkin.com/blog/use-chatgpt-api-with-google-apps-script.html
@user-tu4jb6wx2c
@user-tu4jb6wx2c Жыл бұрын
@@benronkin Ive got the code in the editor, API key in the correct place, folder ID in the correct place...and it isnt returning anything. Do I have to have the colum heading match the "features"? I have differnt data than you show here.
@benronkin
@benronkin Жыл бұрын
@@user-tu4jb6wx2c When you log the API response what do you see?
@lloydl2943
@lloydl2943 Жыл бұрын
Could chatgpt write most of the appscript code?
@benronkin
@benronkin Жыл бұрын
In its current form, I don't believe so. I tried to write a few code snippets with it, and there were a lot of issues. For one, it suffers from "hallucinations", where it "invents" methods that don't exist on certain objects, or it ignores specific instructions. Another issue is that to develop large code bases, you would need to give very specific and very detailed instructions, like pseudo-code, which limits the benefits of the AI. I think that ChatGPT is good for doing preliminary research on a programming domain that you don't have a lot of experience in. It can offer a starting point, and then you need to use your dev experience to make the code functional and robust. Just my two cents.
@markk364
@markk364 Жыл бұрын
I would love to see a video on how to create and use a form that submits to a google sheet. Anyone?
@benronkin
@benronkin Жыл бұрын
Do you mean something like this: kzfaq.info/get/bejne/jsBhiNei2pPNpok.html
@davidnorris8456
@davidnorris8456 Жыл бұрын
Ben - Great Stuff. I implemented all of it and it was working really well. Then I encountered an issue of the App Starting and Completing in a second without it delivering an output. I can't figure out why it's not performing now when it was yesterday. Changed API and went over it. Any tips? Love the videos and for a nub like me so helpful.
@benronkin
@benronkin Жыл бұрын
Thank you. Have you tried to run it in Debug mode, going line-by-line and seeing what you're getting?
@davidnorris8456
@davidnorris8456 Жыл бұрын
@@benronkin Thanks Ben - yes have done this. It still not executing consistently though
@benronkin
@benronkin Жыл бұрын
@@davidnorris8456 Check the response from OpenAI. Maybe it's an API quota issue.
@user-ud7wz6rj9z
@user-ud7wz6rj9z Жыл бұрын
Boa noite amigo, coloque a tradução👍
@benronkin
@benronkin Жыл бұрын
Thanks
Build a Telegram chat bot for ChatGPT with Google Apps Script
30:33
你们会选择哪一辆呢#short #angel #clown
00:20
Super Beauty team
Рет қаралды 13 МЛН
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 33 МЛН
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 77 МЛН
Getting Started Coding in Apps Script
12:16
Better Sheets
Рет қаралды 4,3 М.
You’re using ChatGPT wrong
9:31
Jeff Su
Рет қаралды 355 М.
A GENIUS Way to use ChatGPT for Presentations!
7:38
Jeff Su
Рет қаралды 110 М.
How to use AI like GPT-3 in Google Sheets
2:58
Peter Mangan
Рет қаралды 73 М.
Connecting OpenAI GPT-4 with Google Sheets (Google Apps Script)
10:44
Tech with Hitch
Рет қаралды 9 М.
How to access an API with Google Apps Script
9:52
saperis
Рет қаралды 58 М.
How to Use ChatGPT in Google Sheets (Full Tutorial)
14:42
Bardeen
Рет қаралды 62 М.
Use ChatGPT To Code App Scripts
7:47
Maven Analytics
Рет қаралды 4,5 М.
Google Apps Script Tutorial for Beginners
23:54
saperis
Рет қаралды 366 М.
Make an API With Google Sheets and Google Apps Script
15:53
Cukmekerb's Coding Class
Рет қаралды 60 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,7 МЛН
Опыт использования Мини ПК от TECNO
1:00
Андронет
Рет қаралды 476 М.
Самый дорогой кабель Apple
0:37
Romancev768
Рет қаралды 201 М.