Home Advanced functionality

Advanced functionality

Christian
By Christian
1 article

Workflow Expressions in Simply CRM

Workflow Expressions in Simply CRM Workflow expressions allow you to build powerful, flexible automations inside Simply CRM. They make it possible to calculate values, manipulate text, work with dates, query other modules, and process structured data — all without writing custom code. Expressions are evaluated when a workflow runs and can be used to: - Update field values - Control workflow conditions - Build dynamic email content - Prepare data for integrations and webhooks Below is the complete reference of all workflow expressions available in Simply CRM, including how they work and practical examples for each. Core operators and conditional logic Arithmetic operators Supported operators: +, -, *, / Examples - amount + 25 - (quantity * listprice) - discount_amount Comparison operators Supported operators: ==, <, >, <=, >= Examples - amount > 1000 - closingdate < get_date('today') if(condition, value_if_true, value_if_false) Evaluates a condition and returns one of two values depending on whether the condition is true or false. Examples - if(amount > 1000, 'High value', 'Normal') - if(str_contains(interests, 'Support'), 'Send support pack', 'Skip') Text & string functions substring(string, start, end) Returns part of a string starting at a given position. If end is omitted, the substring continues to the end of the string. Examples - substring(subject, 0, 10) - substring(email, 0, 3) - substring(accountname, 5) preg_replace_str_only(pattern, replacement, subject) Performs a regular-expression-based replace on a string. If the replacement is [], it is treated as an empty string. Examples - preg_replace_str_only('/\s+/', '', phone) - preg_replace_str_only('/\D+/', '', cf_vat_number) - preg_replace_str_only('/^INV-/', '', invoice_no) split(string, seperator, index) Splits a string by a separator and returns the value at the specified index (0-based). Examples - split(email, '@', 0) - split(email, '@', 1) - split(cf_tags, ',', 2) concat(value1, value2, ...) Joins multiple values together into a single text string. Examples - concat(firstname, ' ', lastname) - concat('Deal: ', potentialname, ' (', amount, ')') - concat('https://example.com/ticket/', ticket_no) changeCase(sourcefield, operation) Changes the case of a string. Supported operations include: upper, lower, ucfirst, ucwords. Multibyte variants are also supported. Examples - changeCase(lastname, 'upper') - changeCase(firstname, 'ucfirst') - changeCase(fullname, 'ucwords') UrlDecode(sourcefield) Decodes URL-encoded text (for example %20 → space). Examples - UrlDecode(cf_url_params) - UrlDecode('Hello%20World%21') - Decode webhook payload fragments stored in a field Date & time functions get_date('today' | 'tomorrow' | 'yesterday') Returns a date value relative to the current day. Examples - get_date('today') - add_days(get_date('tomorrow'), 7) - if(closingdate < get_date('yesterday'), 'Overdue', 'OK') add_days(datefield, number_of_days) Adds days to a date or datetime value. Examples - add_days(createdtime, 7) - add_days(duedate, 1) - add_days(get_date('today'), 14) sub_days(datefield, number_of_days) Subtracts days from a date or datetime value. Examples - sub_days(duedate, 3) - sub_days(closingdate, 30) - sub_days(get_date('today'), 1) add_months(datefield, number_of_months) Adds months to a date or datetime value. Examples - add_months(createdtime, 1) - add_months(closingdate, 3) - add_months(get_date('today'), 12) sub_months(datefield, number_of_months) Subtracts months from a date or datetime value. Examples - sub_months(closingdate, 1) - sub_months(get_date('today'), 6) - sub_months(contract_end_date, 2) add_time(timefield, minutes) Adds minutes to a time or datetime value. Examples - add_time(meeting_start, 30) - add_time(createdtime, 15) - add_time(get_date('today'), 60) sub_time(timefield, minutes) Subtracts minutes from a time or datetime value. Examples - sub_time(meeting_start, 10) - sub_time(deadline, 60) - sub_time(modifiedtime, 5) time_diff(date1, date2) Returns the time difference between two date/time values. If only one parameter is provided, the difference is calculated against the current time. Examples - time_diff(modifiedtime, createdtime) - time_diff(closingdate) - if(time_diff(closingdate) < 0, 'Overdue', 'On time') time_diffdays(date1, date2) Returns the difference between two dates in days. If only one parameter is provided, it compares against the current date. Examples - time_diffdays(closingdate, createdtime) - time_diffdays(duedate) - if(time_diffdays(duedate) > 30, 'Long lead', 'Normal') getDateValue(datefield, format) Formats a date or datetime value using a PHP-style date format. Examples - getDateValue(createdtime, 'Y-m-d') - getDateValue(duedate, 'd/m/Y') - concat('Due: ', getDateValue(duedate, 'd/m/Y')) Numeric functions power(base, exponent) Raises a number to a given power. Examples - power(2, 3) - power(probability, 2) - power(amount, 0.5) GetTime(decimal_hours) Converts a decimal hour value into HH:MM format. Examples - GetTime(1.5) - GetTime(cf_estimated_hours) - concat('Duration: ', GetTime(cf_duration_decimal)) Multi-select & list handling str_contains(value1, value2) Checks whether two pipe-separated (|##|) lists share at least one common value. Designed for multi-select picklist fields. Examples - str_contains(interests, 'Support') - str_contains(interests, 'Support|##|Renewals') - if(str_contains(cf_regions, 'EMEA'), 'EU team', 'Other') Cross-module & advanced functions GetFieldValue(field_reference) Returns the value of a field from the current record or from a referenced record. Examples - GetFieldValue(email) - GetFieldValue((contact_id : (Contacts) firstname)) - GetFieldValue((account_id : (Accounts) accountname)) searchModule(module, field, operator, value, returnFields) Searches another module and returns matching records as JSON. Supported operators: equal, contains, notequal. Examples - searchModule('Contacts','lastname','contains','Smith','[id,email]') - searchModule('Accounts','accountname','equal','[Acme,Globex]','[id,accountname]') - searchModule('Users','email1','contains','@example.com','[id,user_name]') json_get(fieldname, path) Extracts a value from a JSON object using dot notation. Examples - json_get(cf_payload, 'customer.name') - json_get(cf_payload, 'items[0].sku') - json_get(cf_payload, 'meta.version\\.raw') json_set(fieldname, path, value) Sets or updates a value inside a JSON object using dot notation. Examples - json_set(cf_payload, 'customer.name', 'Alice') - json_set(cf_payload, 'items[0].qty', 3) - json_set(cf_payload, 'meta.lastUpdated', get_date('today')) jsonArrayMerge(value1, value2) Merges two JSON objects or arrays into one. Examples - jsonArrayMerge('{"a":1}', '{"b":2}') - jsonArrayMerge(cf_jsondata, '{"status":"new"}') - Merge two integration payloads into a single object json_get_line_items(recordId) Returns inventory line items (Products & Services) as JSON. If no record ID is provided, the current record is used. Examples - json_get_line_items(id) - retrieves the line items of the current record (just referenced as id) - Store line items in a custom JSON field - Extract totals or quantities from returned line item data RecurrenceRuleAsDates(rule, format, endDate, startDate) Expands a recurrence rule into a list of dates within a given range. Examples - RecurrenceRuleAsDates(recurrence_rule, 'd/m/Y', '31/12/2026', '01/01/2026') - Generate scheduled dates from repeating events - Use recurrence output to drive task or event creation

Last updated on Feb 04, 2026