Result checks
A result check is a rule for the data a step returns: enough rows, no empty emails, unique ids and so on. Checks catch bad data before later steps load or send it. Every step type except Chart can have checks.
Add a check
- Open the job in the editor and select the step.
- Under Result checks, click Add check.
- Choose the rule in Check and fill in its fields.
- In When it fails, choose Stop the job or Warn.
- Save the job.
Run the step once before adding checks: the field inputs then suggest column names from its last result. A field that was not in that result is marked Not in the last run of the step.
Check kinds
| Check | Settings | Fails when |
|---|---|---|
| Minimum rows | Rows | the result has fewer rows |
| Maximum rows | Rows | the result has more rows |
| Fields present | Fields | a field is missing in every row |
| Not empty | Fields | a row has a field that is null, missing or blank text |
| Unique | Fields | two rows share the same combination of values |
| Allowed values | Field, Allowed values | a value is not in the list |
| Matches pattern | Field, Regular expression | a text value does not match the pattern |
A few details:
- Allowed values compares values as text, so
1and"1"are equal. - Matches pattern uses JavaScript regular expressions, for example
^[A-Z0-9-]+$. - Unique, Allowed values and Matches pattern skip empty values. Combine them with Not empty when a value is required.
- A dotted field name such as
address.cityreads a nested value.
Which rows are checked
Checks read the step result as rows. An array is checked as it is; any other value counts as one row.
When the rows sit inside a larger object, such as an API response { "items": [...] }, enter the path in Rows from: items, data.results or items[0].rows. If the path is not in the result, every check of the step fails with Path ... is not in the result.
Stop or warn
Stop the job fails the step. The job stops after it, and the steps that depend on it do not run. The step result still stays in the run, so you can look at the data that failed.
Warn lets the job continue. The run is recorded as successful, with the warnings attached.
Checks run whenever the step runs: in a full run, a scheduled run, and when you run part of the job or a debug run.
Where results appear
Results appear in Execution history on the job page:
- A run with warnings shows Warnings: N next to its status.
- In the run, each step with a failed check lists the check, the number of failing rows and up to five sample rows.
- A run stopped by a check shows the failed checks under Failed checks in its error details.
Notifications for scheduled runs
For scheduled runs QueryLane sends a macOS notification when:
- a check with Stop the job stops the run (Scheduled run stopped by a result check);
- the run finishes with check warnings (Scheduled run finished with check warnings: N);
- the run fails for any other reason (Scheduled run failed).
Click the notification to open the job. Turn these notifications on or off with Scheduled runs in Settings > Notifications. Runs you start yourself do not send macOS notifications.