How to receive WhatsApp messages inside Google sheets in real-time

Learn how to sync Google Sheets with WhatsApp

How to receive WhatsApp messages inside Google sheets in real-time
Google Sheets synched with your WhatsApp chats

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.

馃挕
If you are looking to send WhatsApp messages from your Google Sheets, check out this article.

Requisites

  • 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

Zaps screen
  • 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.
Choose the WhatsApp number you connected to 2Chat
  • 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.
Trigger testing

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 Row in 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:
Field Name Description
ID the ID of the message
remote number the other person's phone number
session the ID of the session you can use to see that conversation on 2Chat
message the actual message sent
author who sent that message
date when did that message was created
The newly created sheet
  • 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.
All 2Chat fields available to map
  • 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: