Filter
A Filter node passes on the items that match its condition, and the items that do not match are not processed further on that path. Use it to process only the invoices with a positive total, to keep only the files received from one AS2 partner, or to exclude the rows a Transform node produced that have no customer number.
Filter accepts file items and data items, and the items it passes on are unchanged.
Filter is one of several ways to select items in an Automation. If you are not sure Filter is the right node, see Comparing Filter to Related Features below.
Settings
The node takes one Condition, a TransformScript expression without braces that evaluates to true or false for each item, the same as an If condition. payload.total > 0 passes on the data items or parsed files whose total is positive, and attributes.custom_metadata.as2_from == "Acme-AS2" passes on the files received from one AS2 partner.
What the Next Node Receives
The next node receives only the items whose condition was true. An item whose condition was false is not passed on and is not an error. Run detail shows the number of items the node passed on, as a count on the connection after it. When no item matches, the nodes after it receive no items and are Skipped.
Errors
When the condition cannot be evaluated for an item, that item fails. Error Handling rules on the node determine what happens to a failed item. A condition that is not a valid expression fails at save, and the message gives the position of the failing field in the JSON definition.
Comparing Filter to Related Features
If and the trigger's file patterns also select items, and Content Validation also checks a file's contents against a rule you write.
Filter vs. If
If passes every item on, to its True path or its False path. Filter passes on only the matching items. Use Filter when the items that do not match need no further processing. Use If when they do.
Filter vs. the Trigger's File Patterns
A trigger's Incoming File Pattern and Exclude Pattern select files by their names and paths before the run has any items, and they apply to the whole run. A Filter node runs after earlier nodes, so its condition can use what those nodes added, for example the text an Extract node read from a document or the rows a Transform node produced, and it can apply to one path of a branched graph. Use the trigger's patterns to select files by name. Use Filter to select items by their contents or by values another node produced.
Filter vs. Content Validation
Content Validation checks the files in an Expectation's delivery window against a TransformScript after the window closes, and it does not move or route a file. Filter tests each item while an Automation is running and passes on the ones that match. Use Content Validation to record whether a delivery was correct. Use Filter to process only the items that meet a condition.