How I managed to export contents of emails to Google Sheets with the help of ChatGPT ????
Photo by?Jonathan Kemper?on?Unsplash

How I managed to export contents of emails to Google Sheets with the help of ChatGPT ????

In this article, I explain how I leveraged ChatGPT to create a Google script that fetches email content to Google Sheets. I want to share this especially with my non-developer friends who might not be aware of the potential of AI tools.

ChatGPT | https://ai.com | cool domain, right?

The story:?I am managing a WordPress website that uses?WP Forms?which allows you to create custom forms for your website visitors to fill out. WP Forms is a great tool for this purpose, and it offers a premium version that includes an add-on to gather form inputs into?Google Sheets. This feature can be very useful in many cases, but for a small website like the one I manage, the free version of WP Forms is more than enough for what I need. However, what if I still want to export email content to a Google Sheet? This is where the power of AI comes in! ??

Since I was trying ChatGPT for a while, I had this amazing idea of asking the AI bot if it can write me a script that exports email content to a Google Sheet. And?with the help of ChatGPT, I was able to accomplish this in under 10 mins.

Here we go!

I simply asked ChatGPT if it could

“write me a script to export email content to a Google Sheet”

and it started sharing code with me. While the initial code was good, I needed further help to understand and edit it.

I was curious enough to search on Google if there is already a script that does the same job. That's how I found?this code?on GitHub, kudos to Tiago Gouvêa for the code.

Then comes my second amazing idea ?? which is pasting the code to ChatGPT and seeing what happens.

Here is what happened:

No alt text provided for this image
ChatGPT checking and commenting about the code

So, I learned in detail what this code does and how it works. It even commented about how well this code was written!

I checked the code to try to understand what is happening. So, I need a search query and the code does the rest. But how does it connect to my Gmail?

Then I thought why not ask for more help

No alt text provided for this image
ChatGPT explaining how the script works

Ok, that makes sense ?? And it works.

This code successfully creates rows on my Google Sheet and adds three columns of information;?Date, From Address, To Address.?In this case, I need to change the code to fulfill my needs.

I created a label on Gmail and created a filter to label the incoming emails if they include specific words in the subject field, in my case, it is?wpforms_entries.

Ok, ChatGPT. Can you just change the code as I request? Here we go again:

No alt text provided for this image
ChatGPT applying the changes I want to the code

After ChatGPT is done, I copy and paste the code to Apps Script on my Google Sheets…. and… viola!

I have the form's inputs extracted from Gmail on my test sheet! Simply amazing!

No alt text provided for this image
The happiness of success

For the ones, who do not know how to run a script on Google Sheets, I can suggest asking the question to an AI tool ??

The power of AI has enabled a non-developer like me to accomplish this complex(!) task with ease. By using ChatGPT, I created a Google script to fetch email content to Google Sheets in under 10 minutes with the power of AI! ????! With AI, we can simplify tasks and make them accessible to everyone, regardless of their technical expertise. #AI #GoogleSheets #ChatGPT #Productivity

And, yes, I asked the AI to write the last paragraph

Tiago Gouvêa

Melhoro empresas com o uso da tecnologia | IA Generativa | Desenvolvimento de Sistemas e Aplicativos

1 年

Great Sercan! GPT had a high potential to help with code and any kind of implementation. I use it frequently. Thanks for sharing!

Vivek Senthil Kumar

?? Project Manager | Mastering Program Management & Digital Transformation ??♂? | Optimizing Processes & Automation to drive innovation & achieve exceptional outcomes ?? | SAP, Microsoft Dynamics 365, RPA ?

1 年

Awesome ????

要查看或添加评论,请登录

社区洞察