Skip to content

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.

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

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

  1. Every hour the automation reads your Companies sheet.

  2. It picks out rows that have a company name but no Salesforce ID yet.

  3. For each one it checks Salesforce for an existing account and creates one only if there isn't a match.

  4. The Salesforce ID is written back to the row so it won't be processed again.

  5. 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

RunsEvery hour
Create Salesforce accounts from a Google Sheettoday, 9:00Succeeded
Email · New accounts3 new Salesforce accounts from your sheet Litware Inc Adventure Works Cycles Proseware Ltd

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
  • 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

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.
create_salesforce_accounts_from_sheet_rows.pyexample
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?
A tab called Companies with the company name in column A, the website in column B and an empty column C for the Salesforce ID. You can ask for a different layout.
How does it decide a company already exists?
It looks for an account with exactly the same name. You can ask for it to match on website domain as well, which catches variations like Ltd and Limited.
What if I delete the ID from a row?
The row is treated as new on the next run; if the account still exists it's matched and the ID is written back, not duplicated.
What permissions does it need?
sheet edit; api. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
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 “Create Salesforce accounts from a Google Sheet” from your assistant

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