The moment it happens
Turn form leads into Salesforce leads and alert sales
Every form submission becomes a scored Salesforce lead, and the hot ones are posted to #sales straight away.
- Runs
- The moment it happens
- Apps
- Salesforce, Slack
- AI
- Optional
- Access
- api; chat:write
Send this to your assistant
Create a ClickRuntime automation: give me a link my lead form can send to. Score each lead from 1 to 10, create it in Salesforce if it isn't there already, and post leads scoring 8 or more to #sales.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A B2B software company gets demo requests through its website form. They land in an inbox, someone copies them into Salesforce at the end of the day, and the sales team learns about a request from a large prospect the next morning, after the prospect has already booked demos elsewhere.
This automation creates the Salesforce lead the moment the form is sent, skips people who are already leads, and posts the promising ones to #sales with a score and a reason.
What you get out of it
Leads are in Salesforce instantly
No end-of-day copying, so reports and assignment rules see every lead as it arrives.
No duplicate leads
If someone fills in the form twice, the existing lead is kept and no second record is created.
Hot leads get attention first
Only leads scoring 8 or more are posted, so #sales stays focused.
Context travels with the lead
The score and reason are saved in the lead's description, so whoever picks it up knows why it was rated that way.
How it works
What happens, step by step
Your form sends each submission to the automation's link.
It checks Salesforce for an existing lead with the same email and stops if there is one.
AI scores the lead from 1 to 10 and gives a short reason.
A new lead is created in Salesforce with the score in its description.
Leads scoring 8 or more are posted to #sales with a link.
Before it runs live
- Connect Salesforce
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
- Paste your automation's link into the other app's webhook settings
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
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Google Sheets
- Combine it with other Salesforce and Slack steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_event, credentials, http, ai, notify
INSTANCE = "https://yourcompany.my.salesforce.com"
API = f"{INSTANCE}/services/data/v61.0"
SCHEMA = {"type": "object", "properties": {"score": {"type": "integer"}, "reason": {"type": "string"}},
"required": ["score", "reason"]}
@on_event
def handle(event):
form = event.json or {}
email = form["email"].replace("'", "")
headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
found = http.get(f"{API}/query", headers=headers, params={
"q": f"SELECT Id FROM Lead WHERE Email = '{email}' AND IsConverted = false LIMIT 1"}).json()["records"]
if found:
return {"lead": found[0]["Id"], "new": False}
r = ai.generate(f"Score this lead 1-10 for fit and buying intent.\nCompany: {form.get('company')}\n"
f"Message: {str(form.get('message', ''))[:1500]}", json_schema=SCHEMA, max_output_tokens=100).json
lead_id = http.post(f"{API}/sobjects/Lead", headers=headers, json={
"Email": email, "FirstName": form.get("first_name"), "LastName": form.get("last_name") or email,
"Company": form.get("company") or "Unknown", "LeadSource": "Web", "Rating": "Hot" if r["score"] >= 8 else "Warm",
"Description": f"{form.get('message', '')}\n\nAI score {r['score']}/10: {r['reason']}"}).json()["id"]
if r["score"] >= 8:
notify.slack(f"Hot lead ({r['score']}/10): <{INSTANCE}/{lead_id}|{form.get('first_name')} {form.get('last_name')}> "
f"at {form.get('company')}\n{r['reason']}", channel="#sales")
return {"lead": lead_id, "new": True, "score": r["score"]}FAQ
Common questions
Which forms can send leads?
How does it decide a lead is hot?
What happens if the lead already exists?
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
Get a morning list of deals that have gone quiet
Each weekday, every rep sees which of their Salesforce deals haven't moved in two weeks, with a suggested next step for each.
See how it worksGet a Friday list of deals that break your sales rules
Every Friday, each rep sees which of their open deals have missing fields, an out-of-date close date or a discount over your limit.
See how it worksSpot risky renewals 90 days out
Every Monday, customer success sees which accounts renewing in the next 90 days show warning signs, and why.
See how it worksKeep exploring
Set up “Turn form leads into Salesforce leads and alert sales” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.