Workflow Step: Check the Data
Check what arrived, like a form or a web request, against a list of rules before anything acts on it, and keep every rule that failed.
What Check the data does
Check the data checks what arrived against a list of rules before anything acts on it. Unlike Route, which stops at the first match, it checks every rule and saves a message for each one that fails. That's useful when you want to send one email that lists everything that's wrong.
Set it up
Add a check for each rule. Each check has:
- Test: A condition that should be true, like
data.request.body.order.total > 0. - Message: What to say when it isn't, like "The order has no total."
After it runs
The step saves:
data.<step id>.passed:trueif every check passed.data.<step id>.failed: How many checks failed.data.<step id>.issues: The messages from the checks that failed, as a list.
Add a When way out with data.<step id>.passed = false for the problem path, and an Otherwise way out for the normal path. To include the problems in an email body, use {{ $join(data.<step id>.issues.message, ", ") }}.