Skip to content

The moment it happens

Log every sale to Airtable and a sheet

Each sale from your store is recorded in Airtable and a Google Sheet, and a note goes to Slack.

Runs
The moment it happens
Apps
Airtable, Google Sheets
AI
Not needed
Access
Airtable write; Sheets edit

Send this to your assistant

Create a ClickRuntime automation: when my store sends a sale webhook, add the sale to my Airtable 'Sales' table and my 'Sales' sheet, and post it to #sales in Slack.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A small digital products shop sells templates and courses through an online store. The founder tracks customers and refunds in Airtable, but the accountant and a business partner want a plain Google Sheet of every sale for the monthly numbers. Copying sales across by hand means the sheet is always a week behind, and the odd sale gets missed.

Writing each sale to both places the moment the store reports it keeps the customer view and the finance view in agreement, and the Slack note gives the team a real-time sense of how the day is going.

What you get out of it

  • Both records from one event

    The same sale lands in Airtable and the sheet within seconds, with the same amount and product.

  • Retries do not double count

    Each sale id is remembered, so if the store sends the same sale twice it is recorded once.

  • Finance gets a plain sheet

    Your accountant works from a sheet they already understand, with no Airtable seat needed.

  • The team sees sales as they happen

    A short line in #sales shows the product and amount.

How it works

What happens, step by step

  1. Your store notifies a private ClickRuntime link each time a sale is made.

  2. It checks whether this sale has already been logged, so a repeated notice is ignored.

  3. The sale is added to your Airtable Sales table with product, amount and customer email.

  4. The same sale is added as a new row in your Sales sheet.

  5. A short message with the product and amount is posted to #sales in Slack.

Before it runs live

  • Connect Airtable
  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Log every sale to Airtable and a sheetjust nowSucceeded
Slack · #salesNew sale: Client Portal Template for $49.00

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Airtable and Google Sheets steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
log_each_sale_to_airtable_and_sheets.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, notify, state

BASE_ID = "appXXXXXXXXXXXXXX"
SHEET_ID = "1AbCdEfGhIjKlMnOpQrStUvWxYz"

@on_event
def handle(event):
    sale = event.json or {}
    sale_id = str(sale.get("sale_id") or event.event_id)
    if state.get(f"sale:{sale_id}"):
        return {"duplicate": True}
    product, email = sale.get("product_name", ""), sale.get("email", "")
    amount = round(float(sale.get("price") or 0) / 100, 2)
    http.post(f"https://api.airtable.com/v0/{BASE_ID}/Sales",
              headers={"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"},
              json={"typecast": True, "records": [{"fields": {"Sale ID": sale_id, "Product": product,
                    "Amount": amount, "Email": email, "Date": event.received_at[:10]}}]}).raise_for_status()
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    sheets.spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Sales!A:E", valueInputOption="USER_ENTERED",
        body={"values": [[event.received_at[:10], sale_id, product, amount, email]]}).execute()
    state.set(f"sale:{sale_id}", True)
    notify.slack(f"New sale: {product} for ${amount:.2f}", channel="#sales")
    return {"logged": sale_id}

FAQ

Common questions

Which stores does this work with?
Any store that can send a webhook when a sale happens, such as Gumroad, Lemon Squeezy or a Stripe checkout. Map the store's field names for product, price and email in the script.
What if the store sends the amount in cents?
Some stores send whole currency units and others send cents. The script converts the price once, so check the first sale in both places and adjust the divisor if needed.
Can refunds be logged too?
Yes. If the store sends a refund event to the same link, it can be added as a negative row in the sheet and the Airtable record marked refunded.
What permissions does it need?
Airtable write; Sheets edit. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Log every sale to Airtable and a sheet” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.