Every 5 minutes
Save notes and business cards from a Teams chat to OneDrive
Post a note or contact details in a Teams chat and a tidy version is saved to OneDrive, with a reply confirming it.
- Runs
- Every 5 minutes
- Apps
- Microsoft Teams, OneDrive
- AI
- Yes, uses the built-in AI allowance
- Access
- Chat.ReadWrite, Files.ReadWrite
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, check my Notes chat in Teams for new messages, pull out contact details or notes with AI, save them to OneDrive, and reply in the chat to confirm.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
At a trade show or after a client visit, people jot notes and type contact details into whatever is open on their phone, which for many teams is Teams. Those messages scroll away and never make it into a proper file.
Using a Teams chat as the inbox, with AI tidying each note into a consistent format and saving it to OneDrive, turns quick messages on the go into records you can actually find later.
What you get out of it
Capture in the app you already have open
No new app to install. Type a note into a Teams chat and it's handled.
Contacts in a consistent format
Names, companies, emails and phone numbers are pulled out of the message. Every contact is saved the same way.
Notes you can find later
Each note is saved in OneDrive with a date. They're searchable instead of buried in chat history.
Confirmation in the chat
A reply tells you it was saved and what was understood. You can correct it on the spot.
How it works
What happens, step by step
Every 5 minutes it checks your chosen Teams chat for new messages.
AI reads each message and decides whether it is a contact or a note, then tidies it up.
Contacts are added to a contacts file and notes are saved as dated files in OneDrive.
A reply in the chat confirms what was saved.
It remembers the last message it handled, so nothing is saved twice.
Before it runs live
- Connect Microsoft Teams
- Connect OneDrive
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 Microsoft Teams and OneDrive steps into one automation
Under the hood
The code that runs this automation
GRAPH = "https://graph.microsoft.com/v1.0"
import csv, io
from datetime import datetime, timezone
from clickruntime import on_trigger, credentials, http, state, ai, report_fetched
CHAT_ID = "your-chat-id"
SCHEMA = {"type": "object", "properties": {"kind": {"type": "string", "enum": ["contact", "note"]}, "name": {"type": "string"},
"company": {"type": "string"}, "email": {"type": "string"}, "phone": {"type": "string"}, "note": {"type": "string"}}, "required": ["kind"]}
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}
since = state.get("since") or "2026-01-01T00:00:00Z"
msgs = [m for m in http.get(f"{GRAPH}/chats/{CHAT_ID}/messages", headers=h, params={"$top": 30}).json()["value"]
if m["createdDateTime"] > since and m.get("from", {}).get("user") and not m["body"]["content"].startswith("✅")]
report_fetched(len(msgs))
if not msgs:
return {"summary": "Nothing new"}
for m in msgs:
r = ai.generate(m["body"]["content"][:2000], system="Is this a contact or a note? Extract the fields.", json_schema=SCHEMA, max_output_tokens=200).json
if r["kind"] == "contact":
line = io.StringIO(); csv.writer(line).writerow([r.get(k, "") for k in ("name", "company", "email", "phone")])
old = http.get(f"{GRAPH}/me/drive/root:/Notes/contacts.csv:/content", headers=h).text
http.put(f"{GRAPH}/me/drive/root:/Notes/contacts.csv:/content", headers=h, data=(old + line.getvalue()).encode())
reply = f"✅ Saved contact {r.get('name')} ({r.get('company', '')})"
else:
stamp = datetime.now(timezone.utc).strftime("%Y-%m-%d-%H%M")
http.put(f"{GRAPH}/me/drive/root:/Notes/{stamp}.txt:/content", headers=h, data=r.get("note", "").encode())
reply = f"✅ Saved note {stamp}"
http.post(f"{GRAPH}/chats/{CHAT_ID}/messages", headers=h, json={"body": {"content": reply}})
state.set("since", max(m["createdDateTime"] for m in msgs))
return {"saved": len(msgs)}FAQ
Common questions
Does it read photos of business cards?
Which chat does it watch?
Where are contacts saved?
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
Save email attachments to OneDrive and share them in Teams
Attachments from your inbox are saved to OneDrive and your Teams channel gets a message with a link to each one.
See how it worksSave a monthly report to OneDrive and share it in Teams
At the start of each month a report with last month's figures and a short summary is saved to OneDrive and posted to your Teams channel.
See how it worksLabel new emails automatically
New mail is sorted into labels like Inquiry, Invoice and Newsletter within minutes of arriving.
See how it worksKeep exploring
Set up “Save notes and business cards from a Teams chat to OneDrive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.