On This Page

Introduction to Expressions

ProcessMind’s expression language allows you to create calculated attributes, define conditions for gateways, and transform data within your process models. This feature lets you derive new insights from your data without modifying the source.

What Can You Do With Expressions?

  • Calculated Attributes: Create new data columns derived from existing ones. For example, calculate processing time between events:

    dateDiff(StartTime, EndTime, "minute")
  • Conditional Logic: Define business rules for categorizing data or controlling process flow:

    if(Amount > 10000, "High Value",
      if(Amount > 1000, "Medium", "Low")
    )
  • Data Transformation: Clean, format, and transform text data:

    upper(trim(CustomerName))
  • Time-Based Analysis: Extract time components and create time buckets for analysis:

    bucket(hour(StartTime), 6, "Night", 12, "Morning", 18, "Afternoon", "Evening")

Expression Syntax

Expressions use a familiar syntax similar to spreadsheet formulas:

  • Functions are called with parentheses:

    round(3.14, 1)
  • Operators work between values:

    Amount * 1.1
  • Strings are enclosed in double quotes:

    "Hello"
  • Column names can be used directly:

    StartTime
    Amount
  • Parentheses control evaluation order:

    (a + b) * c
  • Quoted identifiers: If a column name contains spaces or special characters, enclose it in backticks:

    `Order Amount` * 0.1

Quick Examples

  • Calculate Duration in Hours

    dateDiff(StartTime, EndTime, "hour")
  • Categorize by Amount

    if(Amount >= 10000, "Enterprise", 
       if(Amount >= 1000, "Business", "Consumer")
    )
  • Extract Year and Month

    concat(toString(year(Timestamp)), "-", padLeft(toString(month(Timestamp)), 2, "0"))
  • Check for Missing Data

    ifNull(Department, "Unassigned")
  • Calculate Percentage of Total

    divide(Amount, allSum(Amount), 0) * 100
  • Count Errors in Case

    caseCountIf(Status == "Error")