Google Sheet

Google Sheet is a powerful tool for managing customer information, orders, and business data. Normally, connecting a chatbot with Google Sheet requires third-party services such as Zapier or IFTTT, which are costly and limited. With the Google Sheet Block in AhaChat, you can store, update, and retrieve data directly from Google Sheet in a simple, fast, and completely free way.

1. Create a New Sheet

Save Data into Google Sheet

  1. Create a Google Sheet block in AhaChat.

  1. Connect to your Google account

  1. Set column names and values:

  • Column names will be automatically created in Google Sheet.

  • Values can be customer attributes (e.g., {{full_name}}) or user input data (e.g., {{user_phone}}).

2. Use an Existing Sheet

Add New Data into Google Sheet

  1. Create a Google Sheet block.

  1. Connect to your Google account

  1. Copy the Google Sheets link and paste it to sync the spreadsheet

  1. Set column names and values:

  • Column names will be automatically created in Google Sheet.

  • Values can be customer attributes (e.g., {{full_name}}) or user input data (e.g., {{user_phone}}).

Update Data in Google Sheet

  1. Connect to your Google account

  1. Copy the Google Sheets link and paste it to sync the spreadsheet

3. Select the sheet to update:

1 - Select the worksheet (e.g., Sheet1, Sheet2...). 2 - Select the lookup column (similar to VLOOKUP, e.g., Messenger user id). 3 - Select the lookup value (you can use an attribute such as {{messenger_user_id}}). The system will return the first matching row. 4 - Select the column to update (e.g., Order status). 5 - Select the update value (e.g., Order canceled). 6 - You can update multiple columns by clicking Add.

Note:

  • If you select “Insert new row in worksheet when there is a mismatch”, the system will automatically create a new row if no matching data is found.

  • Example: The first time a customer provides information, the system will add a new row. If the customer wants to edit information (e.g., cancel an order), the system will automatically update the correct row of that customer (based on Messenger user id).

Retrieve Data from Google Sheet and Save into Chatbot Attributes

  1. Still create an existing Google Sheet block and then connect with your Google account

  2. Copy the Google Sheets link and paste it to sync the spreadsheet

3. Select the file and worksheet to retrieve information:

1 - Select the worksheet (e.g., Sheet1, Sheet2...). 2 - Select the lookup column (e.g., Messenger user id). 3 - Select the lookup value (e.g., {{messenger_user_id}}). 4 - Select the attribute to save (e.g., makh). 5 - Select the column to retrieve data from (e.g., Customer ID). 6 - You can save multiple attributes by clicking Add.

Example use case:

  • When running a viral chatbot to collect customer information, then sending it to the shipping provider to get a tracking code.

  • Customers can type a command to check their order → the bot will search by Messenger user id → get the value in the Tracking code column → save it to the attribute {{mahoadon}}.

  • This way, the bot can inform customers of their order status based on this tracking code.

With the Google Sheet Block, you can both manage customer data centrally in Google Sheet and integrate it directly into chatbot scenarios in an automated, fast, and cost-effective way.

And it basically works like this: AhaChat takes value 1001, looks for the number in the in the Google Sheet Column "id" — this is Lookup Column and saves it in the specified Attributes, "win_code" and "color" in our case.

For example, value of "coupon_id" is now 3 — this will be Lookup Value. And then AhaChat goes and looks for "3" in the Google Sheet Column "ID" — this is Lookup Column.

It will find a Row with "CKMP" code and "bf3a3a" color then map it to the chosen Attributes.