Skip to content

The moment it happens

Look up and update Airtable records from a Telegram bot

You message your Telegram bot in plain words and it finds, adds or updates records in Airtable, then replies.

Runs
The moment it happens
Apps
Airtable, Telegram
AI
Yes, uses the built-in AI allowance
Access
bot token; Airtable read+write

Send this to your assistant

Create a ClickRuntime automation: when I message my Telegram bot, work out whether I want to find, add or update an employee, do it in my Airtable 'Employees' table, and reply with the result. Only answer people on my allowed list.

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

An office manager at a 40-person company keeps the staff directory in Airtable: phone numbers, desk locations, start dates, managers. They are often away from their desk when someone asks for a colleague's extension or a new starter's details need adding. Opening the base on a phone and finding the right field is slow.

Being able to type 'what's Ana's extension?' or 'add Tom Reyes, starts Monday, sales' to a Telegram bot and get an answer back puts the directory in their pocket, while the records stay in Airtable.

What you get out of it

  • Plain messages, not commands

    You write the way you would to a colleague. AI works out whether you want to find, add or update someone.

  • Answers in seconds

    Look-ups come back in the same chat, so a quick question gets a quick reply.

  • Changes go straight into Airtable

    Additions and updates are written to the Employees table, so the directory stays the single source.

  • Only approved people can use it

    Messages from chats that are not on your allow-list get a short refusal and nothing in Airtable is touched.

How it works

What happens, step by step

  1. You send a message to your Telegram bot, and Telegram forwards it to ClickRuntime.

  2. It checks the sender is on your allowed list and ignores anyone else.

  3. AI works out whether you want to find, add or update someone, and which details you gave.

  4. The Employees table in Airtable is searched, added to or updated.

  5. The bot replies in the chat with what it found or changed.

Before it runs live

  • Connect Airtable
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Look up and update Airtable records from a Telegram botjust nowSucceeded
Telegram · Directory botName: Ana Torres Team: Finance Phone: ext. 214 Desk: 3rd floor, east

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
  • 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 Telegram 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.
query_and_update_airtable_from_a_telegram_bot.pyexample
from clickruntime import on_event, credentials, http, ai
BASE_ID = "appXXXXXXXXXXXXXX"
ALLOWED = {123456789, 987654321}
SCHEMA = {"type": "object", "properties": {"action": {"enum": ["find", "add", "update"]}, "name": {"type": "string"},
          "fields": {"type": "object", "properties": {"Phone": {"type": "string"}, "Team": {"type": "string"},
                     "Start date": {"type": "string"}, "Desk": {"type": "string"}}}}, "required": ["action", "name"]}
@on_event
def handle(event):
    msg = (event.json or {}).get("message") or {}
    chat_id, text = msg.get("chat", {}).get("id"), msg.get("text", "")
    tg = f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage"
    if chat_id not in ALLOWED or not text:
        return {"ignored": True}
    req = ai.generate(text, system="Decide find, add or update for an employee directory. Dates as YYYY-MM-DD.",
                      json_schema=SCHEMA, max_output_tokens=150).json
    api, headers = f"https://api.airtable.com/v0/{BASE_ID}/Employees", {"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"}
    name = req["name"].replace("'", "")
    found = http.get(api, headers=headers, params={"filterByFormula": f"SEARCH(LOWER('{name}'), LOWER({{Name}}))"}).json()["records"]
    if req["action"] == "add":
        http.post(api, headers=headers, json={"typecast": True, "records": [{"fields": {"Name": req["name"], **req.get("fields", {})}}]}).raise_for_status()
        reply = f"Added {req['name']}."
    elif len(found) != 1:
        reply = "No match found." if not found else "Several matches: " + ", ".join(r["fields"].get("Name", "") for r in found[:5])
    elif req["action"] == "update":
        http.patch(api, headers=headers, json={"records": [{"id": found[0]["id"], "fields": req.get("fields", {})}]}).raise_for_status()
        reply = f"Updated {found[0]['fields'].get('Name')}."
    else:
        reply = "\n".join(f"{k}: {v}" for k, v in found[0]["fields"].items())
    http.post(tg, json={"chat_id": chat_id, "text": reply})
    return {"action": req["action"]}

FAQ

Common questions

How does it know which employee I mean?
It searches the Name field for the name you mention. If more than one person matches, it lists them and asks you to be more specific.
Can it delete records?
No. It finds, adds and updates. Deleting stays in Airtable, so a mistyped message cannot remove someone.
Can I use it for something other than employees?
Yes. The same pattern works for inventory, clients or bookings. Change the table name and the fields AI is allowed to fill.
What permissions does it need?
bot token; Airtable read+write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly 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 “Look up and update Airtable records from a Telegram bot” from your assistant

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