The moment it happens
Answer WhatsApp questions from a product sheet
Customers who message your WhatsApp number get an instant answer drawn from the products and FAQs in your Google Sheet.
- Runs
- The moment it happens
- Apps
- Google Sheets, WhatsApp Business
- AI
- Yes, uses the built-in AI allowance
- Access
- whatsapp_business_messaging; Sheet read
Send this to your assistant
Create a ClickRuntime automation: when a customer messages my WhatsApp number, answer them using the products and FAQs in my Google Sheet, and keep the last few messages so follow-up questions make sense.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A small online shop gets the same WhatsApp questions all day: is this in stock, how much is delivery, do you ship abroad. The owner answers between other jobs, and messages that arrive in the evening wait until morning.
Answering from a sheet the owner already keeps up to date gives customers a correct reply in seconds at any hour, and changing an answer is as simple as editing a cell.
What you get out of it
Answers at any hour
Customers get a reply in seconds, including evenings and weekends. Fewer of them give up and buy elsewhere.
Answers you control
The bot only uses what's in your sheet. Update a price or a policy in one cell and every answer changes.
Follow-up questions make sense
Recent messages are remembered for a short while, so 'and in blue?' is understood.
Time back for real conversations
Routine questions are handled for you. You step in for the ones that need a person.
How it works
What happens, step by step
A customer sends a message to your WhatsApp number.
It reads the products and FAQs from your Google Sheet and the last few messages from this customer.
AI writes a short answer using only what's in the sheet, or says it will check with the team.
The reply is sent on WhatsApp and the conversation is remembered briefly for follow-ups.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect WhatsApp Business
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Google Sheets and WhatsApp Business steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, state, ai
SHEET_ID = "your-spreadsheet-id"
WA = "https://graph.facebook.com/v20.0/your-phone-number-id/messages"
def wa(to, text):
http.post(WA, headers={"Authorization": f"Bearer {credentials.secret('WHATSAPP_TOKEN')}"},
json={"messaging_product": "whatsapp", "to": to, "type": "text", "text": {"body": text}}).raise_for_status()
def incoming(event):
changes = [c for e in (event.json or {}).get("entry", []) for c in e.get("changes", [])]
return [(m["from"], m["text"]["body"]) for c in changes for m in c["value"].get("messages", []) if m.get("type") == "text"]
@on_event
def handle(event):
rows = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False) \
.spreadsheets().values().get(spreadsheetId=SHEET_ID, range="FAQ!A:D").execute().get("values", [])
facts = "\n".join(" | ".join(r) for r in rows)[:12000]
for phone, text in incoming(event):
history = state.get(f"h:{phone}") or []
answer = ai.generate("\n".join(history[-6:] + [f"Customer: {text}"]), max_output_tokens=200,
system=f"Answer briefly using only these facts. If unsure, say you'll check with the team.\n{facts}").text.strip()
wa(phone, answer)
state.set(f"h:{phone}", (history + [f"Customer: {text}", f"You: {answer}"])[-6:])
return {"ok": True}FAQ
Common questions
What should the sheet contain?
What happens if the answer isn't in the sheet?
How much history is kept?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Log WhatsApp requests in a sheet with a category
Each request sent to your WhatsApp number is sorted by type and urgency, added to a sheet and acknowledged with a reference number.
See how it worksFollow up unhappy customers on WhatsApp
Feedback is scored for sentiment and logged in your sheet, and customers who were unhappy get a WhatsApp message offering to put it right.
See how it worksGet website leads on WhatsApp and log them in a sheet
Each contact form lead is added to your sheet and sent to your phone on WhatsApp straight away.
See how it worksKeep exploring
Set up “Answer WhatsApp questions from a product sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.