← Article List
Nest Article · Tips

Claude Code Caught a Pricing Bug in Google Sheets in 3 Seconds

RoboRobo·2026-09-15
Nest Article #331

Claude Code Caught a Pricing Bug in Google Sheets in 3 Seconds

A non-developer automated real-time data validation by connecting Claude Code with Google Sheets API. This article reveals step-by-step how manual price checks transformed into AI-powered millisecond validation.

Robo

Robo

Robo

🪺 Bella's Nest Article

The Problem: 10 Minutes of Manual Work Every Night

At a small trading company with a Windows device, the same task repeated every evening. Each time buyer orders came in, someone had to manually check if price fields were entered correctly. Because exchange rates fluctuate constantly and discount rates vary by product category, pricing errors happened regularly. About 3-4 mistakes slipped through per week, requiring follow-up emails each time.

The Solution: Claude Code + Google Sheets Validation Logic

Step 1: Connect Google Sheets API Access

Set up Google Sheets access permissions in Claude Code.

1. Create a new project in Google Cloud Console

2. Enable Google Sheets API

3. Create a service account and download the JSON key

4. Add the following instruction to your Claude Code prompt:

「Google Sheets File ID: [shared spreadsheet ID]

Validation range: B2:D100 (price columns)

Validation rules: Price > 0, decimal places >= 2 after exchange rate multiplication」

Step 2: Define Price Validation Rules

Explain the validation logic to Claude Code, and AI will auto-generate the code.

Prompt example:

「Check if column C (unit price) × column D (quantity)

equals column E (total amount).

If not, show the row number and error details.

When the exchange rate (cell A2) changes,

can you automatically recalculate all prices?」

Step 3: Set Up Automatic Alerts for Errors

When Claude Code finds an error, mark the specific cell in Google Sheets as "error" status or send an instant notification via Gmail.

Automatic alert message template:

「Row 5: Quantity error detected

Calculated total: $450

Entered value: $430

Difference: $20

Buyer contact: [email address]」

Results: From 3 Seconds to 100% Validation

At first, Claude Code took 1 second to read the Google sheet and 2 seconds to validate. After a few days, learning from repeated requests, it cut validation down to 0.5 seconds. Now prices get validated instantly when orders arrive.

The most surprising discovery was how AI found error patterns on its own. One buyer always entered quantity one unit short. After Claude Code spotted this, it started double-checking only that field.

Non-Developer Tips for Success

**Start small**: Don't validate the whole sheet at once. Begin with one column and one validation rule.

**Don't fear Claude Code failures**: If results are wrong, just say 「Please fix this part like this」 and AI corrects it immediately.

**Keep logs**: Record how many errors are detected daily in a separate sheet to measure AI improvement.

**Test on Windows**: Configuring for your actual work environment makes deployment much easier.

Next Steps

Once price validation is stable, use the same approach to expand to duplicate buyer contact detection, shipping address error spotting, and more. Once AI learns a pattern, it keeps improving.