Valstorm Administration & Development3 min read

Formula Functions Reference

This guide provides a comprehensive list of all functions available for use in Formula Fields and other calculation engines within ValStorm.

📋 Syntax Overview

  • Variables: Access record fields using {{record.field_api_name}}.
  • Strings: Use single (') or double (") quotes for text.
  • Booleans: Use TRUE, FALSE, true, or false.
  • Logical Operators:
    • AND: Use AND, and, or &&.
    • OR: Use OR, or, or ||.
  • Comparison Operators:
    • Equal: Use = or ==.
    • Not Equal: Use != or <>.
  • Concatenation: Use the & operator to join strings.

🧠 Logical Functions

IF

Returns one value if a condition is true and another if it is false.

  • Syntax: IF(condition, true_value, false_value)
  • Example: IF({{record.amount}} > 1000, "High Value", "Standard")

AND

Returns TRUE if all arguments are true.

  • Syntax: AND(logical1, [logical2], ...)
  • Example: AND({{record.is_active}}, {{record.score}} > 50)
  • Alternative: {{record.is_active}} && {{record.score}} > 50

OR

Returns TRUE if at least one argument is true.

  • Syntax: OR(logical1, [logical2], ...)
  • Example: OR({{record.status}} = "Closed", {{record.status}} = "Archived")
  • Alternative: {{record.status}} == "Closed" || {{record.status}} == "Archived"

NOT

Inverts the value of its argument.

  • Syntax: NOT(logical)
  • Example: NOT({{record.is_deleted}})

🔤 Text Functions

UPPER

Converts a string to all uppercase letters.

  • Syntax: UPPER(text)
  • Example: UPPER({{record.last_name}})

LOWER

Converts a string to all lowercase letters.

  • Syntax: LOWER(text)
  • Example: LOWER({{record.email}})

LEN

Returns the number of characters in a text string.

  • Syntax: LEN(text)
  • Example: LEN({{record.phone}})

FORMAT_CURRENCY

Formats a number as a currency string.

  • Syntax: FORMAT_CURRENCY(number)
  • Example: FORMAT_CURRENCY({{record.total_price}}) -> "$1,234.56"

🔢 Math Functions

SUM

Adds all the numbers in a list of arguments.

  • Syntax: SUM(number1, [number2], ...)
  • Example: SUM({{record.subtotal}}, {{record.tax}}, {{record.shipping}})

📅 Date & Time Functions

TODAY

Returns the current date in ISO format (YYYY-MM-DD).

  • Syntax: TODAY()
  • Example: IF({{record.due_date}} < TODAY(), "Overdue", "On Time")

NOW

Returns the current date and time in ISO format.

  • Syntax: NOW()

AGE

Calculates the age in years based on a birth date.

  • Syntax: AGE(date)
  • Example: AGE({{record.birthday}}) -> 31

NEXT_BIRTHDAY

Calculates the next occurrence of a birthday.

  • Syntax: NEXT_BIRTHDAY(date)
  • Example: NEXT_BIRTHDAY({{record.birthday}}) -> "2026-07-28"

DATE_ADD

Adds a specific number of units to a date.

  • Syntax: DATE_ADD(date, amount, unit)
  • Units: 'day', 'week', 'month', 'year', 'hour', 'minute'
  • Example: DATE_ADD({{record.created_date}}, 30, 'days')

DATE_DIFF

Calculates the difference between two dates.

  • Syntax: DATE_DIFF(end_date, start_date, unit)
  • Units: 'day', 'hour', 'minute', 'second', 'year'
  • Example: DATE_DIFF(NOW(), {{record.last_contact_date}}, 'days')

🔍 Utility & Inspection

ISNULL

Returns TRUE if the value is null or missing.

  • Syntax: ISNULL(value)
  • Example: IF(ISNULL({{record.manager}}), "No Manager", {{record.manager.name}})

ISBLANK

Returns TRUE if the value is null, missing, or an empty string.

  • Syntax: ISBLANK(value)
  • Example: IF(ISBLANK({{record.middle_name}}), "None", {{record.middle_name}})