Unlocking the Power of AI Formulas in Clay
This might be the single most important lesson in this course for maximizing the value of Clay without maximizing cost: AI formulas.
AI formulas let you generate custom code in your table—credit-free—to format, clean, and reshape data exactly as needed. Too often, users rely on AI integrations instead of AI formulas in large tables, wasting hundreds or even thousands of credits.
So in this lesson, we’ll show you how to use AI formulas to structure data and execute conditional runs so enrichments only run (and only use credits) when they meet specific criteria.
How To Use AI Formulas and Conditional Runs in Clay
Watch the full guided demo below to learn how to use AI formulas, or skip ahead for a step-by-step breakdown.
Using AI Formulas In Clay
AI formulas leverage Clay’s built-in AI to process and structure data.
Clay can enrich companies and people with near-endless amounts of data, from work experience to education history to revenue and funding stage. But what if you want to concatenate company names, or string together job titles to create structured outputs, or add up the total number of educational experiences. AI formulas can do it for you, eliminating the need to manually do it yourself.
For example, let’s say you want to know the total number of educational experiences for each person in your table. Instead of manually counting or writing complex formulas, you can use an AI formula instead. Here’s how (watch the guided demo below to follow along):
- Add a new “formula” column to your table
- Prompt the AI to count the total number of experiences
- AI will generate the appropriate code to give you the desired output
- Save formula and it will automatically count educational experiences
You can apply this same principle to count job experiences or total employees, concatenate company names, or string together multiple columns of data into a single output like when creating snippets for outbound email messages. The possibilities are nearly endless.
💡Tip: The AI might not always give you exactly what you're looking for on the first try. This is normal. You can iterate on your prompts, adjust the wording, or even directly modify the generated code to get the results you need. The preview feature is your friend: use it to get the right data before applying the formula.
Mastering Conditional Runs In Clay
Think of conditional runs as a core use case of AI formulas: they allow you to control when and how your enrichments run, ensuring they only run when necessary. This helps:
- Prevent duplicate or unnecessary enrichments
- Optimize credit usage by executing actions only when needed
- Automatically structure and clean data in real-time
You've already used conditional runs without even knowing it: waterfalls. Waterfalls run a series of enrichments in a specific order, with each subsequent enrichment only running if the previous ones didn't return results. This is achieved through conditional formulas.
You can modify or create your own conditional formulas however you want to build the workflows of your dreams.
For example, let’s say you only want to find (and pay for) personal emails if a work email isn’t found first. Here’s how you can use conditional runs to do it (watch the guided demo below to follow along):
- Add a new enrichment for personal emails
- Click on the “Use AI” button under "Run Settings"
- Use the AI to generate a formula that only runs if the validated work email is blank.
This ensures you're not wasting credits trying to find personal emails for contacts where you already have a work email.
Congrats!
The combination of AI formulas and conditional runs in Clay provides a powerful toolkit for data enrichment and analysis. You can extract deep insights from your data, create custom enrichment flows, and optimize your credit usage—all within the same platform.
With practice, you'll be able to create sophisticated data workflows that give you exactly the information you need, when you need it.
That’s a wrap on AI formulas. Next up, we’ll explore data cleaning and normalization in Clay.
Connect, explore and learn together
Read our GTM blog, or try out our top Claybooks and templates to transform your growth ideas into outreach in minutes.