Query Data Google Sheets

Query Data Google Sheets

Updated 5 months ago

Let Your Bot Answer Questions from Google Sheets

Turn Your Spreadsheet into a Knowledge Base

Imagine you have a product catalog in a Google Sheet with hundreds of items. Now imagine customers can ask your bot questions like "What laptops do you have under $1000?" and the bot instantly finds the answer from your spreadsheet.

That's exactly what we're going to set up. Your bot can search through Google Sheets with hundreds or even thousands of rows and give customers accurate answers in seconds.

And yes, this is completely free.


What This Allows You to Do

When your bot can read and search Google Sheets, you can:

Product Catalogs:

  • "Show me all blue shirts in size large"
  • "What's the price of the wireless mouse?"
  • "Do you have any tablets under $500?"

Schedule & Availability:

  • "What time slots are available on Tuesday?"
  • "Is Dr. Smith available next week?"
  • "What classes start after 3pm?"

FAQ & Knowledge:

  • "What's your return policy?"
  • "How long does shipping take to California?"
  • "What payment methods do you accept?"

Pricing & Services:

  • "How much does a logo design cost?"
  • "What packages do you offer?"
  • "Do you have student discounts?"

Your customers receive immediate responses, and you never need to manually update bot instructions when your data changes. Modify the spreadsheet, and your bot instantly understands the new information.


What You'll Need

  1. A Google Sheet with your data (product list, FAQ, schedule, etc.)
  2. A Boti account - Free
  3. 5 minutes to set everything up

No coding, no complicated setup. If you can use a spreadsheet, you can do this.


Step 1: Prepare Your Google Sheet

The secret to making this work is organizing your spreadsheet with clear headers.

How to Organize Your Data:

Your spreadsheet should have:

  • Clear the column headers in the first row. - These indicate to the bot what each column contains
  • One item per row - Each row is one product, one FAQ question, one time slot, etc.
  • Descriptive column names - "Product Name" instead of "Item", "Price (USD)" instead of "Cost"

Example Product Catalog:

Product Name | Category | Price | Color | Size | Stock Status
Laptop Pro 15 | Laptops | 1299 | Silver | 15 inch | In Stock
Wireless Mouse | Accessories | 29 | Black | Standard | In Stock
Bluetooth Speaker | Audio | 79 | Blue | Small | Out of Stock
Gaming Keyboard | Accessories | 89 | RGB | Full Size | In Stock

Example FAQ Sheet:

Question | Answer | Category
What's your return policy? | We accept returns within 30 days with receipt | Returns
How long is shipping? | Standard shipping takes 5-7 business days | Shipping
Do you ship internationally? | Yes, we ship to over 50 countries | Shipping
What payment methods do you accept? | We accept all major credit cards and PayPal | Payment

Example Appointment Schedule:

Day | Time Slot | Provider | Status | Duration
Monday | 9:00 AM | Dr. Smith | Available | 30 minutes
Monday | 10:00 AM | Dr. Smith | Booked | 30 minutes
Monday | 2:00 PM | Dr. Jones | Available | 45 minutes
Tuesday | 9:00 AM | Dr. Smith | Available | 30 minutes

Key Point: The bot reads hundreds of rows instantly. Don't worry about making your sheet too large - bots are fast at searching data.


Step 2: Connect Your Sheet to Your Bot

Now let's give your bot access to read this data.

What to Do:

  1. Open your Google Sheet and copy the URL from your browser (the web address at the top)

  2. Go to your bot in Boti and open the bot builder

  3. Find "Data Sources" in the bot settings

  4. Click "Add Data Source"

  5. Select "Google Sheets"

  6. Paste your sheet URL and give it a clear name like "Product Catalog" or "FAQ Database"

  7. Authorize access - Click "Allow" when Google asks for permission

Done! Your bot can now read the spreadsheet.


Step 3: Write Instructions for Your Bot

This is where you instruct your bot on utilizing the spreadsheet to respond to inquiries.

The Key Principle:

Tell your bot:

  1. What data is available
  2. How to search for information
  3. How to format answers for customers

Example Instructions for Product Catalog:

You are a helpful shopping assistant for TechStore.

You have access to our complete product catalog in a Google Sheet with these columns:
- Product Name
- Category
- Price
- Color
- Size
- Stock Status

When customers ask about products:
1. Search the sheet to find matching items
2. Present the information in a friendly, clear way
3. If multiple items match, show up to 5 options
4. Always mention the price and stock status
5. If nothing matches, apologize and suggest similar alternatives

Examples of good responses:

Customer: "Do you have wireless mice?"
You: "Yes! I found these wireless mice:
- Wireless Mouse Pro - $29 - Black - In Stock
- Silent Wireless Mouse - $35 - Gray - In Stock
Would you like more details about either of these?"

Customer: "What laptops cost under $1000?"
You: "Great question! I found 3 laptops under $1000:
- Laptop Basic 14 - $699 - In Stock
- Student Laptop - $799 - In Stock
- Chromebook Pro - $899 - In Stock
What features are most important to you?"

Always be helpful and accurate. Only share information that's in the spreadsheet.

Example Instructions for FAQ Bot:

You are a customer service assistant for Danny's Electronics.

You have access to our FAQ database with common questions and answers.

The sheet has these columns:
- Question
- Answer
- Category

When customers ask questions:
1. Search the FAQ sheet for relevant answers
2. Provide the answer in a friendly, conversational way
3. If the exact question isn't in the FAQ, look for related questions
4. If you can't find an answer in the sheet, say: "I don't have that information in my knowledge base. Let me connect you with a human agent who can help."

Never make up answers. Only use information from the FAQ sheet.

Example:

Customer: "How long does shipping take?"
You: "Great question! Standard shipping takes 5-7 business days. If you need your order faster, we also offer express shipping (2-3 days). Would you like to know anything else about shipping?"

Always be warm, professional, and accurate.

Example Instructions for Appointment Scheduling:

You are a scheduling assistant for City Medical Center.

You have access to our appointment availability sheet with these columns:
- Day
- Time Slot
- Provider
- Status
- Duration

When patients ask about appointments:
1. Search the sheet for available time slots
2. Present options clearly with day, time, and provider name
3. Only show slots where Status is "Available"
4. If they request a specific day or provider, filter accordingly

Example:

Patient: "Do you have any openings with Dr. Smith next Monday?"
You: "Let me check Dr. Smith's schedule for Monday... Yes! Dr. Smith has these available slots:
- 9:00 AM (30 minutes)
- 2:00 PM (30 minutes)
- 4:30 PM (30 minutes)
Which time works best for you?"

Never show booked appointments. Only display available time slots.

Step 4: Test Your Bot

Always test before customers start using your bot.

How to Test:

  1. Ask specific questions - "Show me blue shirts" or "What's your return policy?"
  2. Check the answers - Look at your spreadsheet and verify the bot found the right information
  3. Try edge cases - Inquire about non-existent items or search using unconventional criteria
  4. Test with multiple rows - Ensure the bot can search through all your data

Common issues and fixes:

  • Bot says it can't find data - Ensure that the column names in your instructions correspond with the actual headers.
  • Bot shows wrong information - Ensure your instructions clearly specify which columns to search.
  • Bot is slow - This is rare, but if you have 10,000+ rows, consider splitting into multiple sheets

Important Tips

Tip 1: Bots Can Search Hundreds of Rows Instantly

Don't worry about the size of your spreadsheet. Bots are fast at searching data. A sheet with 500 products? No problem. 1,000 FAQ entries? Easy.

Tip 2: Use Clear Column Headers

The bot relies on column names to identify the data it's examining. "Product Name" and "Price (USD)" are much clearer than "Name" and "Cost".

Tip 3: Keep Data Updated

The beautiful thing about this setup is that when you update your Google Sheet, your bot instantly knows the new information. Add a new product? The bot can tell customers about it immediately. Update prices? The bot shares the new prices.

Tip 4: Integrate with Data Collection

You can have one bot that both reads data from sheets (to answer questions) and writes data to sheets (to collect information). See our guide on collecting data with Google Sheets to learn more.

Tip 5: Tell Your Bot What to Do When Data Isn't Found

Always include instructions for when the bot can't find an answer. For example: "If you can't find what the customer is looking for, apologize and offer to connect them with a human agent."


Real-World Examples

Here's what businesses are creating with this feature:

E-Commerce:

  • Product catalogs with search by category, price, color, size
  • Real-time inventory checking
  • Product comparisons and recommendations

Healthcare:

  • Appointment availability checking
  • Provider schedules and specialties
  • FAQ about services and insurance

Restaurants:

  • Menu browsing with prices and ingredients
  • Daily specials and availability
  • Dietary information and allergens

Real Estate:

  • Property listings with search by location, price, size
  • Open house schedules
  • Neighborhood information

Education:

  • Course catalogs with schedules and prerequisites
  • Instructor availability
  • Tuition and financial aid information

Advanced Tips

Searching Multiple Columns:

Your bot can search across multiple columns at once. If someone asks "Do you have any blue laptops?", the bot can search the Category column for "laptop" AND the Color column for "blue".

Providing Comparisons:

You can instruct your bot to compare items: "Compare the Laptop Pro and Laptop Basic" - the bot can show key differences from your spreadsheet.

Filtering and Sorting:

Your bot can filter by any criteria ("Show me all items under $50") and even present them in order ("Show me your three cheapest laptops").


Next Steps

Want to do even more with Google Sheets and bots?


Need Help?

If you run into any issues:

  1. Contact support - We're here to help
  2. Check your column names - Ensure they match precisely between instructions and sheet
  3. Start simple - Test with a small sheet (10-20 rows) before scaling up
  4. Test thoroughly - Ask many different questions to see how your bot responds

Remember: This is free to use, so experiment and find what works for your business!