Understanding Functions

While Properties provide the raw data and settings, Functions allow you to perform specific calculations, retrieve dynamic values, or implement conditional logic within your Formulas.

What are Functions?

Functions are predefined operations identified by a name followed by parentheses (). Some functions require arguments (inputs) inside the parentheses, while others do not. They perform a specific task and typically "return" a value that can be used in your expressions or assigned to variables.

Key Functions Available

Here's an overview of the main types of functions available in the Formulas syntax:

Date/Time Functions

now()

Returns the current timestamp. Essential for comparing timestamp properties (like last bid change) to the present.

interval("Xd")

Converts a duration string (like 7d) into seconds, used primarily for date arithmetic with now().

Conditional Logic Functions

case(...)

Allows you to implement if/then/else style logic. It evaluates conditions and returns a specific value based on the first true condition.

Learn more about Conditional Logic

Variable Definition

let

While not a traditional function call, the let keyword is used to define variables (Custom Properties).

Learn more about Creating Custom Properties

How to Use Functions

You integrate functions into your expressions just like properties or values:

// Using now() and interval() for a date comparison
last bid change < now() - interval("14d")

// Using case() to determine a value
let bid_adjustment = case(
   acos(30d) > 50% => 0.8,
   else 1.0);
// Using the result of case() later
bid > cpc(14d) * bid_adjustment // Use the calculated adjustment

Functions significantly enhance the power and flexibility of your Formulas, enabling dynamic comparisons and complex conditional rules.

For detailed syntax, examples, and return types for each function, please consult the filterable Syntax Reference.

PREVIOUS ARTICLE
NEXT ARTICLE