Every hour
Create Salesforce accounts from a Google Sheet
Companies added to your sheet are created as Salesforce accounts, with no duplicates, and each row gets its Salesforce ID.
- Runs
- Every hour
- Apps
- Google Sheets, Salesforce
- AI
- Not needed
- Access
- sheet edit; api
Send this to your assistant
Create a ClickRuntime automation: every hour, take new rows in my Companies sheet, create the account in Salesforce if it doesn't already exist, and write the Salesforce ID back into the row.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A business development team builds its target lists in Google Sheets: company names from an event, a partner's referral list, research for a new region. Getting them into Salesforce means an import file, field mapping and a clean-up of the duplicates afterwards, so the list often stays in the sheet and the pipeline never shows it.
This automation checks the sheet every hour, creates an account for each new company that isn't already in Salesforce, and writes the ID back so the row is done. The team keeps working in the sheet and Salesforce stays complete.
What you get out of it
Keep working in the sheet
People add companies where they already plan, and Salesforce catches up within the hour.
No duplicate accounts
Each company is checked against existing accounts first; matches are linked instead of created again.
Clear status per row
The Salesforce ID in each row shows at a glance what has been imported.
A note of what's new
You get an email listing the accounts it created, so nothing appears in Salesforce unnoticed.
How it works
What happens, step by step
Every hour the automation reads your Companies sheet.
It picks out rows that have a company name but no Salesforce ID yet.
For each one it checks Salesforce for an existing account and creates one only if there isn't a match.
The Salesforce ID is written back to the row so it won't be processed again.
You get an email listing any new accounts.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- 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
- Act only on the items that match your own rules, and skip the rest
- 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 Salesforce 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, report_fetched, credentials, http, notify
SHEET_ID = "your-spreadsheet-id"
API = "https://yourcompany.my.salesforce.com/services/data/v61.0"
@on_trigger
def run(event):
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
rows = [(r + ["", "", ""])[:3] for r in sheets.values().get(spreadsheetId=SHEET_ID, range="Companies!A2:C").execute().get("values", [])]
todo = [(i, r) for i, r in enumerate(rows, start=2) if r[0] and not r[2]] # name filled, no Salesforce ID yet
report_fetched(len(todo))
if not todo:
return {"summary": "No new rows"}
headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
updates, created = [], []
for i, (name, website, _) in todo:
safe = name.replace("'", "\\'")
found = http.get(f"{API}/query", headers=headers, params={"q": f"SELECT Id FROM Account WHERE Name = '{safe}' LIMIT 1"}).json()["records"]
if found:
account_id = found[0]["Id"]
else:
account_id = http.post(f"{API}/sobjects/Account", headers=headers, json={"Name": name, "Website": website}).json()["id"]
created.append(name)
updates.append({"range": f"Companies!C{i}", "values": [[account_id]]})
sheets.values().batchUpdate(spreadsheetId=SHEET_ID, body={"valueInputOption": "RAW", "data": updates}).execute()
if created:
notify.email_me(f"{len(created)} new Salesforce accounts from your sheet", "\n".join(created))
return {"rows": len(todo), "created": len(created)}FAQ
Common questions
What layout does the sheet need?
How does it decide a company already exists?
What if I delete the ID from a row?
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
Log review sentiment in a sheet and open cases for bad ones
New customer reviews are labelled positive, neutral or negative in a Google Sheet, and negative ones become Salesforce cases.
See how it worksLog every lead in a sheet and create it in Salesforce
Each lead from your form or ads is scored, created in Salesforce and added to a Google Sheet with a link to the record.
See how it worksAudit open deals against rules kept in a sheet
Every Monday, open Salesforce deals are checked against the rules in your Google Sheet and every breach is listed on a Findings tab.
See how it worksKeep exploring
Set up “Create Salesforce accounts from a Google Sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.