Conditions (v2)
In Automations v2, you use conditions to filter files or data and route them to different paths. For example, an order feed can contain both approved orders ready for delivery and orders that need review. A condition tests each item's status, amount, or other values so the Automation can process those cases differently.
Filter passes on only matching items. If sends matching items to its True path and the rest to its False path. Switch checks named rules in order and sends each item to the first matching path, or to Default when none matches. All three use the same condition editor.
Visual Conditions
In the Builder, Filter and If have a Conditions section above Configuration. Each Switch rule has its own name and Conditions. The Editor options are Visual for building comparisons and Expression for writing a TransformScript expression.
Each visual condition row has fields for a Variable, a Property within it, a Compare As type, an Operator, and a Value when the operator needs one. The Builder creates the TransformScript expression for those choices; Expression Preview shows the result.
For a data item representing an order, a row with Variable payload, Property total, Compare As Number, Operator Is Greater Than, and Value 0 matches an order with a positive total. The same row can be part of a Filter that retains those orders or an If that sends the others to review.
Properties Available to a Condition
The values available to a condition come from the item as it reaches that node. Earlier nodes can add metadata, write a different file, or turn a file into data, so the values available later can differ from the original input.
The following sources are available under Variable:
attributescontains information about the current item, such as a file's name, size, modification time, and Custom Metadata. The Property list reflects the items that can reach this node, including information supplied by Incoming Email or Extract. Custom Metadata keys written by an earlier Set Metadata node are also offered; other keys can be entered ascustom_metadata.region.payloadcontains a data item's fields or a file's parsed contents. These fields depend on the input, so you enter the property, such asstatusororder.total. Readingpayloadfrom a file parses its contents; a condition using only file attributes does not read the contents.contextcontains run information. The run's clocks are listed; other values, such as a webhook parameter, can be entered by name asparameters.batch.
Enter property names relative to the selected variable. Names with spaces or punctuation are quoted automatically. A name containing a literal dot needs double quotes, such as "Total.Amount", so it is read as one field rather than a nested path. Array indexes require Expression mode.
A CSV file's parsed contents are a list of rows. To evaluate each row separately, a Transform can return those rows as data items; each row's columns are then available through payload to conditions in later nodes. What an Expression Can Read explains the inputs and how earlier nodes change them.
Comparison Types and Values
Under Compare As, you choose how to interpret the property. The available operators depend on the selected type. Choose a type that reflects the meaning of the value: an order total needs a numeric comparison, while an order identifier may need an exact text match even when it consists of digits.
| Compare As | Comparisons |
|---|---|
| String | Equals, Contains, Starts With, Ends With, Matches Regular Expression, and Is Empty, with their negative alternatives. |
| Number | Equals, Does Not Equal, Is Greater Than, Is at Least, Is Less Than, and Is at Most. |
| Boolean | Is True and Is False. |
| Date | Calendar-date equality and inequality, before or after a date with optional inclusion of that date, and relative age. |
| DateTime | Before or after a date and time with optional inclusion of that instant, and relative age. |
Has a Value and Has No Value are available for every type. These checks and the emptiness checks use the original property without converting it.
With String, the original property is compared with text without conversion. The number 200 therefore does not equal the text "200". For other types, Files.com converts the property when needed. With Number, for example, the text "1000" becomes the number 1000. CSV columns are text, so numeric and date comparisons need Number or Date rather than String.
Text matches are exact and case-sensitive. Contains checks for text within a string, membership in an array, or a key in an object. Starts With and Ends With check the beginning or end of a string. For a case-insensitive comparison, an expression can normalize text with lower() or upper(), such as payload.status != null and lower(payload.status) == "approved".
For Date and DateTime comparisons, values are parsed in ISO 8601 format. With Date, the calendar date is compared as written, without time zone conversion. DateTime values are entered in your user time zone and stored with their UTC offset. The file modification property, attributes.modified_at, defaults to DateTime.
Is Newer Than and Is Older Than compare against a cutoff counted back from the moment each item is evaluated. Enter an amount and a unit: Minutes, Hours, Days, or Weeks for DateTime, and Days or Weeks for Date. This is relative to processing time, rather than a fixed date chosen when you build the Automation.
Missing Values and Conversion Errors
A field can be absent from some incoming records, or present with an unusable value. These produce different results, so the condition needs to reflect how you want to handle them.
Visual comparisons do not match a missing or null property, including Does Not Equal and the other negative comparisons. Has No Value matches missing or null properties. Has a Value matches a present value, including empty text, 0, and false.
Is Empty matches missing or null values, empty text, empty arrays, and empty objects. Is Not Empty matches a nonempty string, array, or object. For example, Has No Value catches an omitted customer number, while Is Empty also catches a customer number supplied as empty text.
If a present value cannot be converted to the chosen type, the item fails and is handled according to the node's Error Handling rules. A total containing "unknown" cannot be compared as Number; it is an error rather than a nonmatching order. A missing total simply does not match that numeric comparison.
Multiple Conditions and Groups
Under Match, you choose how rows are combined. With All Conditions, every row must match. With Any Condition, at least one row must match. For example, require both an approved status and a positive total before an order continues.
For combinations of those rules, choose All Condition Groups when every group must match, or Any Condition Group when at least one group must match. Each group has its own All Conditions or Any Condition choice. For example, with Any Condition Group, an order could match either a group for approved orders with a positive total or a separate group for urgent orders.
The visual editor supports one level of groups. More deeply nested logic requires Expression mode. When you switch from groups to a flat list, you are asked to confirm Remove Groups. Every row is retained, and the rows are combined according to your new Match choice.
Expressions and Reference
Expression mode accepts a TransformScript expression without double braces. It supports comparisons the visual controls cannot express, such as comparing one property with another, accessing an array element, or combining more deeply nested logic. A written expression uses the conversions and missing-value checks you supply; it does not automatically receive the checks used by visual comparisons.
With Edit as Expression, you can write one row as an expression while keeping the other rows visual. To return to controls, choose Edit Visually; this option is available when the controls can represent the expression exactly. An existing written condition opens visually when its meaning can be preserved. A clause the controls cannot represent can remain as an expression row; otherwise the whole condition stays in Expression mode, with an explanation of why Visual is unavailable. Opening a condition does not rewrite its stored expression.
Every FTS Expression field on Filter, If, and Switch, including an individual expression row, has a Reference link. The reference includes available item attributes, payload, run context, and variables; literal values; comparisons and logic; functions; conversions; and examples. Selecting an entry inserts it at the cursor. The TransformScript Function Library supplies the complete function reference.
An unfinished visual row remains when you select another node and return. If you select Save with an incomplete condition, an error is displayed and the affected node is marked. If you switch the whole editor to Expression, unfinished rows are discarded and the last complete expression is displayed. Selecting Cancel discards unsaved changes. Saving and Validation explains validation of the complete Automation.