Using Conditional step Operators

Using Conditional step Operators

When configuring conditions in a Conditional Step, you can apply Operators to build more advanced logic. Operators allow you to manipulate or evaluate data values before your condition is evaluated. This enables more flexible comparisons, such as counting items in an array, checking if a string includes certain characters, extracting email domains, filtering related objects, and more.

You can combine Operators into method chains, where one function operates on the output of the previous one. This allows you to work with complex data structures when defining route logic inside a Conditional Step.

Method Chains

Function Description Argument types Returns Example
.count Returns the number of items in an array. Must follow a method chain that produces an array. Number
.first Returns the first item of an array. Must follow a method chain that produces an array. Item from Array
includes() Returns TRUE if whether a specified item is inside the array. Must follow a method chain that produces an array. Boolean
.last Returns the last item of an array. Must follow a method chain that produces an array. Item from Array
domain(email_string) Returns the domain of an email address. Email string String
username(email_string) Returns the username of an email address. Email string String
length(string) Returns the character count of a string. String Number
replace-all Replaces all instances of a specified string (string1) with a different string (string2). String
replace-chars
replacement
to-be-replaced
characters-to-be-replaced
split
delimiter
trim(string) Removes leading and trailing spaces in a string. String String
collect_from_each(object) Returns array of related objects, including traversing multi-hop relations. current_case.accounts.collect_from_each(inquiries)
returns inquiries related to accounts related to current case
filter('key', 'operator', 'value')
=

Returns only items in array that meet the criteria specified.

Must follow a method chain that produces an array.
current_case.accounts.collect_from_each(inquiries).filter(foo=bar)
returns inquiries where foo=bar related to accounts related to current case
sort_asc(key) Sorts array by key in ascending order.

Must follow a method chain that produces an array.
current_case.accounts.collect_from_each(inquiries).sort_asc(created_at)
returns array of inquiries, sorted ascending by created_at, related to accounts related to current case
sort_desc(key) Sorts array by key in descending order.

Must follow a method chain that produces an array.
current_case.accounts.collect_from_each(inquiries).sort_desc(created_at)
returns array of inquiries, sorted descending by created_at, related to accounts related to current case
page_size(number) Sets array page size. If not set, default is 100. Note the max page size supported is 200. current_case.accounts.collect_from_each(transactions).page_size(200)
returns max of 200 transactions related to accounts related to current case
page_number(number) Sets page number. When array items > 200, page_number() can be used to specify which page of results should be displayed. Note the max page_number supported in 100. current_case.accounts.collect_from_each(transactions).sort_desc(created_at).page_number(2)
returns page 2 of results (i.e. second 100 most recently created transactions related to accounts related to current case)