Skip to content

On a schedule

Fill in missing company details across HubSpot and Salesforce

Every night, companies are matched by website, blank industry, size and phone fields are filled from the other CRM, and you get an email of the changes.

Runs
On a schedule
Apps
HubSpot, Salesforce
AI
Not needed
Access
read+write on both

Send this to your assistant

Create a ClickRuntime automation: every night, match HubSpot companies and Salesforce accounts by website domain, fill blank industry, employee count and phone on either side from the other, and email me what changed.

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

When marketing works in HubSpot and sales in Salesforce, each side fills in different details about the same company. HubSpot knows the industry from a form; Salesforce has the switchboard number a rep typed in. Reports on both sides end up with gaps that the other system could fill.

This automation matches companies to accounts by website every night and copies across any detail that's missing on one side. It never replaces a value that's already there, and you get an email listing every change.

What you get out of it

  • Fuller records on both sides

    Segmenting by industry or size works in both CRMs, because the blanks are filled from the other.

  • Nothing is overwritten

    Only empty fields are filled, so neither team's data is replaced.

  • Matched on website

    Domains are compared without www or https, which matches companies even when names differ slightly.

  • Every change on record

    The nightly email lists exactly what was filled in where.

How it works

What happens, step by step

  1. Every night the automation reads your HubSpot companies and Salesforce accounts.

  2. It matches them by website domain.

  3. For each match, it fills empty industry, employee count and phone fields from the other side, without replacing anything already set.

  4. You get an email listing every field it filled in.

Before it runs live

  • Connect HubSpot
  • Connect Salesforce

What you get

RunsOn a schedule
Fill in missing company details across HubSpot and Salesforcetoday, 9:00Succeeded
Email · CRM syncSalesforce Proseware Ltd: Industry Software, NumberOfEmployees 240 HubSpot Adventure Works: phone +1 425 555 0100

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

  • 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 HubSpot 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.
keep_company_records_enriched_in_both_crms.pyexample
from urllib.parse import urlparse
from clickruntime import on_trigger, credentials, http, notify
HS, API = "https://api.hubapi.com/crm/v3/objects/companies", "https://yourcompany.my.salesforce.com/services/data/v61.0"
FIELDS = [("industry", "Industry"), ("numberofemployees", "NumberOfEmployees"), ("phone", "Phone")]
domain = lambda url: (urlparse(url if "//" in url else f"//{url}").netloc or url).lower().removeprefix("www.")
@on_trigger
def run(event):
    hs, sf = {"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}, {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
    companies, params = {}, {"limit": 100, "properties": "domain,name,industry,numberofemployees,phone"}
    while params.get("after", True):
        page = http.get(HS, headers=hs, params=params).json()
        companies.update({domain(c["properties"]["domain"]): c for c in page["results"] if c["properties"].get("domain")})
        params["after"] = page.get("paging", {}).get("next", {}).get("after")
    accounts = http.get(f"{API}/query", headers=sf, params={"q": "SELECT Id, Name, Website, Industry, NumberOfEmployees, "
                        "Phone FROM Account WHERE Website != null LIMIT 2000"}).json()["records"]
    changes = []
    for a in accounts:
        c = companies.get(domain(a["Website"]))
        p = c["properties"] if c else {}
        to_sf = {sk: int(p[hk]) if sk == "NumberOfEmployees" else p[hk] for hk, sk in FIELDS if p.get(hk) and not a[sk]}
        to_hs = {hk: str(a[sk]) for hk, sk in FIELDS if c and a[sk] and not p.get(hk) and hk != "industry"}  # HubSpot industry is a fixed list
        if to_sf:
            http.patch(f"{API}/sobjects/Account/{a['Id']}", headers=sf, json=to_sf).raise_for_status()
            changes.append(f"Salesforce {a['Name']}: {to_sf}")
        if to_hs:
            http.patch(f"{HS}/{c['id']}", headers=hs, json={"properties": to_hs}).raise_for_status()
            changes.append(f"HubSpot {p['name']}: {to_hs}")
    if changes:
        notify.email_me(f"CRM sync: {len(changes)} records filled in", "\n".join(changes))
    return {"matched_accounts": len(accounts), "changes": len(changes)}

FAQ

Common questions

Why is industry only copied into Salesforce?
HubSpot's industry field accepts only its own fixed list of values, which don't match Salesforce's. Copying from HubSpot into Salesforce is safe; the other way would fail for most values.
What if two accounts share a website?
Each Salesforce account with that website is matched to the same HubSpot company, and blanks are filled on each.
Can it sync more fields?
Yes. Add pairs such as annual revenue, city or country to the list, as long as the values mean the same thing in both CRMs.
What permissions does it need?
read+write on both. 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 runs (on a schedule). Checks that find nothing to do 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 “Fill in missing company details across HubSpot and Salesforce” from your assistant

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