Weekly
Back up your Salesforce records every week
A CSV copy of your accounts, contacts and opportunities is sent to you every week.
- Runs
- Weekly
- Apps
- Salesforce
- AI
- Not needed
- Access
- api (read)
Send this to your assistant
Create a ClickRuntime automation: every Sunday at 11pm, export my Salesforce Accounts, Contacts and Opportunities to CSV and email them to me.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Salesforce holds a company's customer list, contacts and deals, yet many small teams have no copy outside it. A bad bulk update, a misconfigured import or a departing admin deleting records can damage data, and the Recycle Bin only holds items for a limited time. Salesforce's own data export service is available but runs on its own schedule and requires someone to remember to download the files. When a problem is discovered two months later, there is nothing to restore from.
Once a week the automation runs a SOQL query for each of accounts, contacts and opportunities, following the nextRecordsUrl so large objects are fully retrieved. It builds a CSV for each and emails them to you. That gives you dated files you control outside Salesforce. It suits small and mid-sized teams that want a simple safety copy and an easy way to compare data across weeks.
What you get out of it
A copy outside the CRM
If records are changed or deleted by mistake, you have a recent file to compare against. Recovery starts from a known state instead of from guesses about what the data looked like.
Protection against bulk update errors
A wrong mass update can overwrite thousands of rows before anyone notices. Last week's CSV lets you identify exactly which values changed and restore them, which would be very hard from memory.
Handy for audits and handovers
When an accountant, auditor or new sales head asks for a customer list as of a given week, you have it. Weekly files provide a dated record without a manual export each time.
Large objects handled completely
The query follows pagination, so objects with tens of thousands of rows are exported in full. A quick manual report would silently cut off at a view's row limit and give a false sense of safety.
Weekly rhythm without a calendar reminder
Nobody has to remember to click Export. The backup arrives on schedule, so it exists on the day it is needed rather than being intended for next week. A weekly file from the first of the quarter is just as complete as one from yesterday.
How it works
What happens, step by step
Once a week, the automation reads all your Salesforce accounts, contacts and opportunities, however many there are.
Each set is turned into a CSV file with its key fields.
The files are emailed to you, with the record count for each in the subject line.
Before it runs live
- Connect Salesforce
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 Salesforce steps into one automation
Under the hood
The code that runs this automation
import csv, io
from clickruntime import on_trigger, credentials, http, notify
INSTANCE = "https://yourcompany.my.salesforce.com"
QUERIES = {
"Accounts": "SELECT Id, Name, Industry, Website, CreatedDate FROM Account",
"Contacts": "SELECT Id, FirstName, LastName, Email, AccountId FROM Contact",
"Opportunities": "SELECT Id, Name, StageName, Amount, CloseDate, AccountId FROM Opportunity",
}
@on_trigger
def run(event):
headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
counts = {}
for name, soql in QUERIES.items():
page = http.get(f"{INSTANCE}/services/data/v61.0/query", headers=headers, params={"q": soql}).json()
rows = page["records"]
while page.get("nextRecordsUrl"):
page = http.get(INSTANCE + page["nextRecordsUrl"], headers=headers).json()
rows += page["records"]
out = io.StringIO()
writer = csv.DictWriter(out, fieldnames=[f for f in rows[0] if f != "attributes"] if rows else ["Id"], extrasaction="ignore")
writer.writeheader()
writer.writerows(rows)
notify.email_me(f"Salesforce backup: {name} ({len(rows)})", out.getvalue())
counts[name] = len(rows)
return countsFAQ
Common questions
Does the CSV include every field on each object?
Will large files fit in an email?
Is this a replacement for Salesforce's own backup tools?
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
Find open deals with a past close date
Each weekday you see the open opportunities whose close date has passed, grouped by owner.
See how it worksGet a weekly report of duplicate leads
Each week you get the groups of leads that share an email address, ready for you to merge.
See how it worksFill in next steps on open opportunities
Open opportunities with an empty Next Step get a suggested one written in, and you get the list.
See how it worksKeep exploring
Set up “Back up your Salesforce records every week” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.