Formulas

Generate formulas with AI to transform your data.

Overview

Generate formula with AI

To generate a formula with AI:

  1. Enter your formula instructions. Type / to insert a column reference.
  2. Click Generate formula to create your AI formula

AI formula generator examples

Here are examples of formulas you can create with the formula generator:

  1. Extract the domain from {{Email}}
  2. Use {{LinkedIn URL}} if available; otherwise use {{LinkedIn Profile}}.url
  3. Extract the text after @ in {{Twitter Handle}}
  4. Split {{city}} by comma, keep everything before the first comma, remove "Area" if present, then add quotes
  5. Extract the first word from {{Column_1}}, combine with {{Column_2}}, then remove all non-letter characters
  6. Calculate the number of days between {{Created Date}} and {{Closed Date}}

How Clay formulas work

Clay formulas are powered by Clayscript, a JavaScript-based language that evaluates expressions to transform your data. When you generate a formula with AI or write one manually, you're creating JavaScript expressions that Clay runs row-by-row.

What's available in formulas:

  • Standard JavaScript: All standard JavaScript objects and methods including Math, String, Array, Date, RegExp, Number, Object, and more.
  • Lodash: Access the full Lodash library using _ for advanced data manipulation.
  • Moment.js: Use Moment.js with moment for powerful date and time operations.
  • Excel and Google Sheets functions: Clay supports hundreds of familiar spreadsheet functions like VLOOKUP, IF, SUM, CONCATENATE, and many more through the FormulaJS library.
  • Column references: When you reference a column like {{Email}}, Clay automatically passes the value from that column into your expression.

FAQs

Can I create or change my formula without running it?

Yes! When editing a formula, you'll see the option to Save and don't run enrichments.

Clicking this prevents your formula from running on any enrichment columns that would cost credits. These columns will appear greyed out to indicate they're out of date.

Explore other docs

Getting started

Table versions

Table versioning lets you track structural changes to your Clay tables over time and restore previous configurations when needed.

View article
Getting started

Table alerts

Table alerts automatically monitor your Clay tables and notify you when something needs attention.

View article
Export

Salesforce integration FAQs

Answering common questions about connecting and troubleshooting the Salesforce integration.

View article
Web scraping

Meer integration

Screen phone numbers against national do-not-call registries before initiating outbound calls.

View article
Settings & admin

Best practices for B2B email direct marketing

Conduct effective outbound email outreach whilst also lowering the risk of challenges

View article
Settings & admin

Do Not Contact (DNC) compliance & best practices

Information about DNC compliance and best practices.

View article
Web scraping

BuyerCaddy integration

Enrich company tech stacks, verify technology usage, and more!

View article

Other popular resources

Experts

Find a Clay Expert

Explore our network of Clay experts and agencies.

View experts
Community

Join our slack community

Find help in our slack community, and support channels.

Go to slack
Cohorts

Join a cohort, learn Clay fast!

The faster way to master Clay. Sign in if you're enrolled in a cohort (current or past) or apply!

Learn more about cohorts
Talents

Hire GTME Talent

Find and connect with GTM talent who've demonstrated expertise in building advanced workflows

Explore GTME talents