Systems Lab

Agent skill

conditional-logic

Write Clayscript formulas, conditional runs, and credit-saving logic in Clay.

slowingReaches the webInstructions only575 words

Filed under Prospecting and list building.

From Frontal-so/outbound-skills · 73 skills · 4 · pushed 2026-07-14

What it does when it runs

Write Clayscript formulas, conditional runs, and credit-saving logic in Clay. Use when the user asks about Clayscript, Clay formulas, conditional runs, saving credits with logic, data manipulation, if/then logic, JavaScript formulas in Clay, or the AI formula generator. Triggers on "Clayscript", "formula", "conditional run", "credit saving", "data manipulation", "if/then", "JavaScript formula", "conditional formula", "Clay formula", "save credits", "only run if". Do NOT use for Claygent prompting, enrichment provider selection, or table structure questions.

Read from the skill and the 0 files bundled beside it. A skill’s own description is written to be selected by an agent, so it describes the job and not the dependencies.

Keys and connectors you must supply
None found.
Hosts it reaches
  • frontal.so
Tool permissions it declares
No allowed-tools in the frontmatter. It only issues instructions, so there is nothing to bound.
Actions present in the files
None. Instructions only.

Ask about conditional-logic

Opens your assistant with this page's verified links already in the prompt.

Is this safe to install?ClaudeChatGPT
Adapt it to my stackClaudeChatGPT
What else do I need for it to workClaudeChatGPT
Rather ask a human? Talk to Cheetah
git clone --depth 1 --filter=blob:none --sparse https://github.com/Frontal-so/outbound-skills.git /tmp/outbound-skills
git -C /tmp/outbound-skills sparse-checkout set "master-skills/clay/.claude/skills/conditional-logic"
mkdir -p ~/.claude/skills/conditional-logic
cp -R "/tmp/outbound-skills/master-skills/clay/.claude/skills/conditional-logic/." ~/.claude/skills/conditional-logic/

Picked up without a restart. A project skill of the same name is shadowed by your personal one. For one repository only, swap ~/.claude/skills for .claude/skills. Claude Code docs ↗

The folder is the same in every client that implements the format — 46 of them — so if yours is not above, only the destination changes.

Reproduced in full from Frontal-so/outbound-skills/blob/27cd847be5ce7e9b749b1d672cbfb29935d911db/master-skills/clay/.claude/skills/conditional-logic/SKILL.md, which is licensed MIT (repository). 575 words, 9 headings.

Conditional Logic & Clayscript

You help users write Clayscript formulas, set up conditional runs, and build credit-saving logic in Clay.

References

  • Read {SKILL_BASE}/resources/formulas/clayscript-guide.md for syntax, libraries, and AI formula generator.
  • Read {SKILL_BASE}/resources/formulas/copy-paste-formulas.md for ready-to-use formulas (name cleaning, domain extraction, email waterfall, seniority check, employee buckets, table layout).
  • Read {SKILL_BASE}/resources/expert-tips-eric-noski.md for Rule 1 (conditionals on all paid integrations) and Rule 5 (formulas over AI).

Core Rule: Formulas Cost 0 Credits

Formulas are FREE. Always prefer formulas over AI columns for:

  • Cleaning/formatting data
  • Combining fields (first + last name)
  • If/then logic and scoring
  • Abbreviations (New Jersey --> NJ)
  • Extracting domain from email
  • Any standard JavaScript operation

Syntax

  • Describe mode: Use /field_name to reference columns
  • Raw mode: Use {{FieldName}}
  • Libraries available: Lodash (_), Moment.js (moment), FormulaJS (VLOOKUP, IF, SUM)
  • Null safety: Always add || "" to avoid errors on empty cells

Essential Conditional Run Formulas

// Only run if field is empty (most common)
/email is empty

// Only run if previous enrichment completed but returned nothing
Clay.getCellStatus(#{{field_id}}) == "completed" AND {{previous_column}} == ""

// Only run on high-value leads
/lead_score > 70 AND /industry equals "SaaS"

// Only run if email is valid
/email_validation equals "valid" OR /email_validation equals "catchall valid"

// Skip already-enriched rows
/revenue is empty AND /domain is not empty

// Combined: CRM push only if ready
/email is not empty AND /email_validation equals "valid" AND /lead_score > 50

Common Data Manipulation Formulas

// Extract domain from email
{{email}}.split("@")[1] || ""

// Combine first + last name
({{first_name}} || "") + " " + ({{last_name}} || "")

// Capitalize first letter
({{name}} || "").charAt(0).toUpperCase() + ({{name}} || "").slice(1).toLowerCase()

// Bucket company size
{{employee_count}} > 1000 ? "Enterprise" : {{employee_count}} > 200 ? "Mid-Market" : {{employee_count}} > 50 ? "SMB" : "Startup"

// Clean LinkedIn URL
({{linkedin_url}} || "").replace(/\/$/, "").split("?")[0]

AI Formula Generator

  1. Add column --> select Formula type
  2. Type instructions in plain English: "Extract the domain from the email column"
  3. Use / to reference columns
  4. Click "Generate Formula"
  5. Verify sample output on 3-5 rows
  6. Save

Tip: If the AI generator fails, screenshot the formula need and use ChatGPT -- it sometimes writes better Clayscript.

Credit-Saving Checklist

  1. Every paid enrichment MUST have a conditional run (non-negotiable)
  2. Check if data already exists before calling a provider
  3. Use formulas to derive data instead of enriching (e.g., company size bucket from headcount)
  4. Chain conditionals: only run Provider 2 if Provider 1 returned empty
  5. Disable auto-update on expensive columns during testing

Examples

Example 1: "I want to only push leads to HubSpot if they have a valid email and score above 80" --> Conditional run on CRM push column: /email_validation equals "valid" AND /lead_score > 80. This prevents bad data from entering your CRM.

Example 2: "How do I extract the company name from an email domain?" --> Formula column: ({{email}} || "").split("@")[1].split(".")[0]. Capitalize: .charAt(0).toUpperCase() + .slice(1). Cost: 0 credits.

Example 3: "My Clay table is burning credits because enrichments run on every row" --> Add conditional runs to every paid column. Minimum: "field is empty". Better: "field is empty AND /domain is not empty". Check auto-update settings (disable during testing). Review credit usage report.


Part of Frontal — free, open GTM skills for your AI agent. Browse the library →

Other skills for the same job

Different authors, same problem. Matched on the words in the skill name, across every library in the catalogue except this one.

Need help setting it up?

This page tells you what conditional-logic does and what it needs. Cheetah builds the agent setup it runs inside: data, CRM, sequencing and the guardrails.

Book a call →

The directory stays free. There is nothing gated behind this.