How to receive WhatsApp messages inside Google sheets in real-time
Learn how to sync Google Sheets with WhatsApp
TL;DR; there's a video at the bottom of the article where you can see the integration in action.
In this tutorial, we are going to learn how to use 2Chat along with Zapier to automatically back up and receive WhatsApp messages inside Google Sheets.
This integration works both for Personal WhatsApp and WhatsApp Business. If you aren't sure what's the difference between them, check out this post to learn more.
- You will need a WhatsApp phone number 😛.
- Also, a Gmail or Google Suite account to use Google Sheets.
- Create a 2Chat account and connect your WhatsApp number to it. The process is very straightforward and takes only a few seconds from start to finish.
- Finally, you will need Zapier. If you aren't already using them, they are a no-code automation service. You can create a free account on their website.
Creating the trigger on Zapier
- Open your zaps screen on Zapier and create a new one.
- Look for 2Chat and select it.
- Choose one of the available triggers. In this case, we are going to need
New WhatsApp Message.
- Zapier will ask you for your 2Chat API key to do the connection to our services. You can obtain that key on app.2chat.io/user > API access. More information on how to obtain it is on our Developers Portal.
- Find and choose the number you have just connected to 2Chat after you created your account.
- Test your connection. This requires 2Chat to send to Zapier the last message you have sent or received (WhatsApp groups don't count). Make sure you have either sent or received at least one message after you connected your number to 2Chat to be able to make the connection test.
Making 2Chat send messages to Google Sheets
You can make Zapier do anything you want with the messages you send or receive on your WhatsApp, but for this tutorial, we are going to stick to sending them to Google Sheets 😉.
- Find Google Sheets among the list of actions Zapier provides
- We want each new message to create a row on the sheet. For that to happen, we need to select
Create Spreadsheet Rowin the list of events.
- Now would be a good time to create a new Google Sheet where the WhatsApp messages will be written down. Inside your Google Drive, create a new sheet and name it whatever you prefer. The only thing to consider is the columns on it and we recommend you add the following:
||the ID of the message|
||the other person's phone number|
||the ID of the session you can use to see that conversation on 2Chat|
||the actual message sent|
||who sent that message|
||when did that message was created|
- Now you will need to let Zapier see the spreadsheets you have in your Google Drive. Follow their instructions to establish that connection.
- Once connected, find and select the sheet you have just created.
- Finally, map the 2Chat fields to your Google Sheet fields.
- The final result should look something like this:
- Test the action and if you can see the rows being inserted in your Google Sheet, you are done! You can now publish the zap.
The end result in action
Watch it in action on the demo below: