Skip to content

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.

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

  1. Your form or ad platform sends each new lead to the automation's link.

  2. AI scores the lead from 1 to 10 from their company and message.

  3. A lead is created in Salesforce with the score in its description.

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

RunsThe moment it happens
Log every lead in a sheet and create it in Salesforcejust nowSucceeded
Google Sheets · Leads2026-10-19 09:42 | Riley | Adams | riley@wideworldimporters.example | Wide World Importers | 8 | Salesforce link

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

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.
lead_intake_to_sheets_and_salesforce.pyexample
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?
Date and time, first name, last name, email, company, score and the Salesforce link, in that order, on a tab called Leads.
Can it record which campaign the lead came from?
Yes. If your form sends a source or campaign field, it's saved as the lead source in Salesforce, and you can ask for it to be added to the sheet too.
Does it check for duplicates?
This version creates a lead for every submission. Ask your AI assistant to add a check on email address if people often fill in your form twice.
What permissions does it need?
sheet edit; api. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in AI allowance.
How many runs does it use?
One run for each event the app sends.
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 “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.