Daily
Keep your sheet free of duplicates and bad data
Duplicate rows are removed, names and phone numbers are tidied, and invalid emails are flagged.
- Runs
- Daily
- Apps
- Google Sheets
- AI
- Not needed
- Access
- read+write
Send this to your assistant
Create a ClickRuntime automation: every night, remove duplicate rows in my Leads sheet by email address, tidy up names and phone numbers, flag invalid emails in a Flag column and email me how many rows changed.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A sales operations assistant maintains a contact sheet fed by imports, form submissions and manual entries. Over months it fills with the same person entered twice, emails with a typo like gmial.com, names in ALL CAPS, phone numbers in five formats and stray spaces. Mailings bounce, reps call the same person twice, and a VLOOKUP that should match two sheets fails because one has a trailing space.
Each day, ClickRuntime reads the range and normalizes the values: trimming spaces, fixing capitalization, standardizing phone numbers and checking whether emails look valid. It detects duplicate rows, writes the cleaned values back, adds a Flag column explaining what it found, and emails you a count of the changes it made.
Marketing lists, CRM exports, event registrations and membership sheets all benefit from regular cleanup.
What you get out of it
Fewer bounced emails
Catching invalid addresses and obvious typos before a campaign goes out keeps bounce rates down. Email providers watch these rates, and a clean list protects the reputation your messages depend on.
Contacts are not approached twice
Duplicate rows lead to two reps sending nearly the same message to one person. Finding them early avoids the embarrassment and the lost goodwill that come from it. Customers also notice when they are not emailed twice.
Lookups and pivot tables work again
Trailing spaces and inconsistent capitalization break matches between sheets. Once values are normalized, formulas that join data return the right results and totals add up. Reports then match reality, which helps every later analysis.
Every change is explained
The Flag column says what was fixed or what looks wrong, and the email gives counts. Nothing disappears silently, so someone can check a questionable change instead of trusting blindly.
Data stays clean instead of piling up
A short daily pass is easier than a heroic cleanup every year. Errors are handled while the person who entered them still remembers what they meant. Small fixes made daily rarely turn into a big project.
How it works
What happens, step by step
Every day ClickRuntime reads your leads Google Sheet.
It tidies names and email addresses, removes duplicate rows and drops rows with an email address that isn't valid.
The cleaned list is written back to the sheet.
You get an email saying how many rows were changed or removed and how many are left.
Before it runs live
- 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
- 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 steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import re
from clickruntime import on_trigger, credentials, notify
SHEET_ID = "your-spreadsheet-id"
EMAIL = re.compile(r"^[^@\s]+@[^@\s]+\.[a-z]{2,}$", re.I)
@on_trigger
def run(event):
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
rows = sheets.values().get(spreadsheetId=SHEET_ID, range="Leads!A2:D").execute().get("values", [])
seen, clean, changed = set(), [], 0
for row in rows:
name, email, phone, _ = (row + [""] * 4)[:4]
key = email.strip().lower()
if key and key in seen:
changed += 1
continue
seen.add(key)
new = [" ".join(name.split()).title(), key, re.sub(r"[^\d+]", "", phone), "" if EMAIL.match(key) else "Invalid email"]
changed += new != (row + [""] * 4)[:4]
clean.append(new)
sheets.values().clear(spreadsheetId=SHEET_ID, range="Leads!A2:D").execute()
sheets.values().update(spreadsheetId=SHEET_ID, range="Leads!A2", valueInputOption="RAW", body={"values": clean}).execute()
notify.email_me("Leads sheet tidied", f"{changed} rows changed or removed, {len(clean)} rows left.")
return {"changed": changed}FAQ
Common questions
Does it delete duplicate rows?
How does it decide two rows are duplicates?
Can it check whether an email address really exists?
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
Monitor your sites and SSL certificates
You're warned when a site in your list is down or its certificate expires within 14 days.
See how it worksGet alerts for upcoming dates in a sheet
You're emailed when a date in your sheet is coming up or a value crosses a limit.
See how it worksGet a daily list of tasks due
Each morning you get the rows in your tracker that are due today or overdue.
See how it worksKeep exploring
Set up “Keep your sheet free of duplicates and bad data” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.