The moment it happens
Log 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.
- Runs
- The moment it happens
- Apps
- Google Sheets, Salesforce
- AI
- Optional
- Access
- sheet edit; api
Send this to your assistant
Create a ClickRuntime automation: when my lead form sends a lead, score it from 1 to 10, create a Salesforce lead, and add a row to my Leads sheet with the score and a link to the lead.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A marketing manager runs campaigns across ads and landing pages and needs to see what each one brings in, today, without a Salesforce report licence for every agency contact. Sales, meanwhile, needs every lead in Salesforce straight away.
This automation does both from one form submission: it creates the lead in Salesforce with an AI score, and adds a row to a shared Google Sheet with the same score and a link. Marketing has its log, sales has its lead.
What you get out of it
One source, two places
Each lead lands in Salesforce and in the sheet at the same moment, so the two never disagree.
A log for people outside Salesforce
Agencies and partners can see lead flow in the sheet without a Salesforce login.
Scores for quick triage
Each lead carries a 1-10 score so the obvious good ones are easy to spot in both places.
Links back to the record
The sheet row links straight to the Salesforce lead for anyone who has access.
How it works
What happens, step by step
Your form or ad platform sends each new lead to the automation's link.
AI scores the lead from 1 to 10 from their company and message.
A lead is created in Salesforce with the score in its description.
A row is added to your Leads sheet with the details, score and a link to the Salesforce lead.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Salesforce
- 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 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 datetime import datetime, timezone
from clickruntime import on_event, credentials, http, ai
SHEET_ID = "your-spreadsheet-id"
INSTANCE = "https://yourcompany.my.salesforce.com"
API = f"{INSTANCE}/services/data/v61.0"
@on_event
def handle(event):
lead = event.json or {}
score = ai.generate(f"Score this lead 1-10 for fit and intent. Reply with the number only.\n"
f"Company: {lead.get('company')}\nMessage: {str(lead.get('message', ''))[:1500]}",
max_output_tokens=5).text.strip()
headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
lead_id = http.post(f"{API}/sobjects/Lead", headers=headers, json={
"FirstName": lead.get("first_name"), "LastName": lead.get("last_name") or lead["email"],
"Email": lead["email"], "Company": lead.get("company") or "Unknown", "Phone": lead.get("phone"),
"LeadSource": lead.get("source") or "Web", "Description": f"{lead.get('message', '')}\n\nAI score: {score}/10"}).json()["id"]
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")),
cache_discovery=False).spreadsheets()
sheets.values().append(spreadsheetId=SHEET_ID, range="Leads!A1", valueInputOption="RAW", body={"values": [[
datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M"), lead.get("first_name", ""), lead.get("last_name", ""),
lead["email"], lead.get("company", ""), score, f"{INSTANCE}/{lead_id}"]]}).execute()
return {"lead": lead_id, "score": score}FAQ
Common questions
Which columns does it write?
Can it record which campaign the lead came from?
Does it check for duplicates?
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
Audit 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 worksBuild a white-space table of what key accounts haven't bought
Each month, a Google Sheet shows every key account against your product list, marking what they own and counting the gaps.
See how it worksCreate 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.
See how it worksKeep exploring
Set up “Log every lead in a sheet and create it in Salesforce” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.