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.
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
Every night the automation reads your HubSpot companies and Salesforce accounts.
It matches them by website domain.
For each match, it fills empty industry, employee count and phone fields from the other side, without replacing anything already set.
You get an email listing every field it filled in.
Before it runs live
- Connect HubSpot
- 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 HubSpot and Salesforce steps into one automation
Under the hood
The code that runs this automation
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?
What if two accounts share a website?
Can it sync more fields?
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
Send marketing-qualified HubSpot contacts to Salesforce
Contacts that reach MQL in HubSpot are created as Salesforce leads within 30 minutes, without duplicates, and sales hears about them in Slack.
See how it worksKnow the moment your website goes down
Your team hears in Slack when the site stops responding or slows down, and again when it's back.
See how it worksPost a morning briefing to Slack
Your team starts the day with the weather, a reminder or anything else you'd like in #general.
See how it worksKeep exploring
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.