Every 15 minutes
Check purchase requests against your budget sheet
New purchase requests in Airtable are checked against the department budget in your sheet and approved, flagged or rejected.
- Runs
- Every 15 minutes
- Apps
- Airtable, Google Sheets
- AI
- Optional
- Access
- Airtable read+write; Sheets read
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, check new purchase requests in Airtable against my budget sheet. Approve ones well within budget, reject ones over it, and send me any that need a person to decide in Slack.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
At a growing company, staff log purchase requests in an Airtable form: a new laptop, a software seat, a conference ticket. Finance keeps the remaining budget per department in a Google Sheet. Every request means opening both, finding the department line, and doing the sum. Small requests wait days for an answer they could have had in minutes.
Comparing each request with the remaining budget as it comes in clears the routine ones straight away and sends only the borderline requests to a person, with the numbers already worked out. AI reads the justification on those borderline requests and suggests a decision.
What you get out of it
Routine requests are approved quickly
Requests well inside the department's remaining budget are set to Approved without waiting for a review.
Over-budget requests are caught
Anything that would take a department over its budget is marked Rejected with the reason written on the record.
Borderline ones come to you with context
You get a Slack message with the amount, the remaining budget and a suggested decision, so you can answer in one look.
The budget stays in the sheet finance owns
Finance keeps editing the same sheet. The automation reads it fresh on each run.
How it works
What happens, step by step
Every 15 minutes, ClickRuntime looks for purchase requests in Airtable with no status yet.
It reads the remaining budget for each department from your budget sheet.
Small requests within budget are approved, and requests over budget are rejected with a reason.
For anything in between, AI reads the justification and suggests a decision.
Those requests are marked as needing approval and posted to you in Slack.
Before it runs live
- Connect Airtable
- Connect your Google Sheets account and pick the spreadsheets it may use
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 Airtable and Google Sheets 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_trigger, credentials, http, ai, notify, report_fetched
BASE_ID = "appXXXXXXXXXXXXXX"
SHEET_ID = "1AbCdEfGhIjKlMnOpQrStUvWxYz"
@on_trigger
def run(event):
api = f"https://api.airtable.com/v0/{BASE_ID}/Purchase%20requests"
headers = {"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"}
records = http.get(api, headers=headers, params={"filterByFormula": "{Status}=''"}).json()["records"]
report_fetched(len(records))
if not records:
return {"checked": 0}
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
rows = sheets.spreadsheets().values().get(spreadsheetId=SHEET_ID, range="Budget!A2:B").execute().get("values", [])
left = {r[0]: float(r[1]) for r in rows if len(r) == 2}
for rec in records:
f = rec["fields"]
amount, remaining = float(f.get("Amount") or 0), left.get(f.get("Department"), 0.0)
if amount <= remaining * 0.2:
status, note = "Approved", "Within budget"
elif amount > remaining:
status, note = "Rejected", f"Over budget: {remaining:.0f} left"
else:
status = "Needs approval"
note = ai.generate(f"Request: {f.get('Item')} for {amount:.0f}. Budget left: {remaining:.0f}.\nReason: {f.get('Justification', '')[:1000]}",
system="Suggest approve or decline in one sentence.", max_output_tokens=80).text
notify.slack(f"Needs approval: {f.get('Item')} ({f.get('Department')}) {amount:.0f} of {remaining:.0f} left. {note}", channel="#finance")
http.patch(api, headers=headers, json={"records": [{"id": rec["id"], "fields": {"Status": status, "Decision note": note}}]}).raise_for_status()
return {"checked": len(records)}FAQ
Common questions
What counts as 'well within budget'?
Does AI make the final decision?
Does it subtract approved requests from the budget sheet?
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
Research companies from a sheet into Airtable
Companies you add to a sheet are looked up and saved in Airtable with industry, size and a short summary.
See how it worksImport leads from a sheet into your Airtable CRM
New leads pasted into a sheet are added to Airtable as companies, without duplicates, and marked imported.
See how it worksSave every form entry to Airtable and a sheet
Each form submission becomes an Airtable record and a sheet row, and you get an email confirming it arrived.
See how it worksKeep exploring
Set up “Check purchase requests against your budget sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.