Daily
List low-stock items from Supabase in a purchasing sheet
Each night, items in your Supabase inventory that are below their reorder level are written to your purchasing sheet, and you get an email to review and approve them.
- Runs
- Daily
- Apps
- Google Sheets, Supabase
- AI
- Not needed
- Access
- Supabase read+write; sheet edit
Send this to your assistant
Create a ClickRuntime automation: each night, read stock levels from my Supabase inventory table, write items below their reorder level to my Purchasing sheet with a suggested order quantity, and email me to approve.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
An ecommerce brand tracks stock in its own Supabase-backed system, but purchasing is done by an ops manager who lives in spreadsheets. Every week they export the table, filter low items and work out quantities by hand.
A nightly purchasing sheet, already filtered and with suggested quantities, gives the ops manager a ready list to approve each morning.
What you get out of it
A ready purchasing list each morning
Low items, current stock and suggested quantities are waiting in the sheet.
Approval stays with a person
Nothing is ordered automatically; the email asks you to review.
No exports
The sheet is refreshed from the live table every night.
Fewer stock-outs
Items are flagged as soon as they cross their reorder level.
How it works
What happens, step by step
Each night, ClickRuntime reads every active item from your Supabase inventory table.
It picks out items whose stock is below their reorder level and works out a suggested order quantity.
It replaces the Purchasing tab in your sheet with the current list.
If anything is low, you get an email asking you to review and approve the list.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Supabase
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
- Run it at a different time, more or less often, or only on weekdays
- 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 Google Sheets and Supabase 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, notify
SHEET_ID = "your-spreadsheet-id"
SUPABASE = "https://your-project.supabase.co/rest/v1"
def sb(method, path, **kw):
key = credentials.secret("SUPABASE_KEY")
r = http.request(method, f"{SUPABASE}/{path}", **kw, headers={"apikey": key, "Authorization": f"Bearer {key}", "Prefer": "return=representation,resolution=merge-duplicates"})
return r.raise_for_status() or (r.json() if r.content else None)
@on_trigger
def run(event):
items = sb("GET", "inventory?active=is.true&select=sku,name,quantity,reorder_level,target_level")
low = [i for i in items if i["quantity"] < i["reorder_level"]]
rows = [["SKU", "Item", "In stock", "Reorder level", "Suggested order", "Approved?"]]
rows += [[i["sku"], i["name"], i["quantity"], i["reorder_level"], (i.get("target_level") or 2 * i["reorder_level"]) - i["quantity"], ""] for i in low]
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
sheets.values().clear(spreadsheetId=SHEET_ID, range="Purchasing!A:F").execute()
sheets.values().update(spreadsheetId=SHEET_ID, range="Purchasing!A1", valueInputOption="RAW", body={"values": rows}).execute()
if low:
notify.email_me(f"{len(low)} items to reorder – please review", "\n".join(f"{r[1]}: {r[2]} in stock, order {r[4]}" for r in rows[1:])
+ f"\n\nApprove in the sheet: https://docs.google.com/spreadsheets/d/{SHEET_ID}")
return {"low": len(low)}FAQ
Common questions
How is the order quantity suggested?
Does the sheet keep old lists?
Which items are included?
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
Keep a Supabase knowledge base in sync with your FAQ sheet
Each night, new or edited rows in your FAQ sheet are turned into search-ready entries in your Supabase documents table, so your bots always answer from the latest version.
See how it worksFind people asking for tools like yours and list them in a sheet
Every hour, posts from people looking for a tool like yours are scored, stored in Supabase and added to a leads sheet for your team.
See how it worksList at-risk clients from Supabase in a sheet every morning
Every morning, clients who haven't visited in 14 days are written to your At Risk sheet and you get an email summary.
See how it worksKeep exploring
Set up “List low-stock items from Supabase in a purchasing sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.