An alert is a SQL query that runs on a schedule and emails people when its conditions are met. Create one when people need to hear about a change in your data without opening the Editor themselves.
To create an alert that emails only you, you need Create Alerts, which the Alert Creator preset includes. To add other people or roles as recipients, you also need Notify Others With Alerts, which the Alert Manager preset includes. See Permission reference for every preset.
Either permission shows the New alert button. Without Notify Others With Alerts, the Recipients card has no Roles field and People lists only you; the card reads You can only send alerts to yourself.
You cannot create or change an alert while you are viewing DataMind OS as another user. See Impersonate a user.
Write and check the query in the Editor first. See Write and check SQL.
Runs as is the role whose access the query uses. The list shows the roles you hold, or every role if you hold the admin role. Changing Runs as on a saved alert needs the new role as well.
Test runs the query with the access of the role in Runs as. It saves nothing and emails no one. Saving runs the same checks as Test. A new alert shows Pending until its first run. Preview email opens the exact email the alert would send; after you edit the draft, the preview is out of date until you run Test again.
A card that hides a problem is marked Needs attention: open it to see the message under the field, for example Name is required or Pick at least one role or person.
Clicking outside the editor does not close it, so a half-written query is safe. Close the editor with Cancel or the close button. If the alert in the address no longer exists, the editor shows Alert not found with Back to alerts.
Trigger has two modes:
In a rule-based alert, click Add rule. A new rule starts as Rows matching with Any. Each rule has one of these kinds:
| Rule kind | What it checks |
|---|---|
| Row count | The number of rows the query returns, for example greater than 100. |
| Aggregate | First value of, Minimum of, Maximum of, Sum of, Average of or Distinct count of a column, compared with a value. |
| Rows matching | Whether Any, No or Every row has a column that meets a condition. |
| Always | Every run counts as a match. |
The conditions you can pick depend on the column's type:
Enter dates as YYYY-MM-DD. Before your first Test, the editor offers every condition, and you type the column name yourself. After Test, you pick the column from a list of the query's columns. A rule that needs no value hides its Value box: Always, is empty (NULL) and is not empty.
With two or more rules, Trigger when appears. All rules triggers when every rule matches. Any rule triggers when at least one matches. After Test, each rule shows its value and a tick or a cross.
A rule-based alert needs at least one rule before you can save it. With no rules yet, the section reads No rules yet. If you switch it back to Query based, its rules are kept but not applied.
Runs is Daily, Weekdays, Weekly or Monthly. Weekly asks for a Day, from Monday to Sunday. Monthly asks for a Day of month, from 1 to 31. Shorter months run on their last day. A time that is not a valid 24-hour value shows Use a 24-hour HH:mm time, and a monthly day outside 1 to 31 shows Pick a day from 1 to 31.
Alerts run on the server's clock, not on your browser's. The editor shows the current server time under the time picker.
Under Schedule, Email controls when emails go out:
A failed run never sends an email.
You need at least one role or person (Pick at least one role or person). Each address receives the email once. Deactivated users are skipped, and a deactivated role reaches nobody.
[{{status}}] {{alert_name}}. The variables are {{alert_name}}, {{status}}, {{value}}, {{row_count}} and {{run_at}}. {{status}} becomes TRIGGERED or BACK TO NORMAL, {{value}} is the first value a rule produced, and {{run_at}} is the run time in the server's time zone. A variable the alert does not know stays as you typed it.failed-card-transactions. xlsx.Until you run Test, the Columns field is disabled and every column is used. An empty subject is refused with The email needs a subject, and a row limit outside 1 to 100 with Show between 1 and 100 rows.
| Setting | What it does | Default |
|---|---|---|
| Name | Names the alert in the list and in its attachment. | Empty, required |
| Runs as | The role whose access the query uses. | Empty, required |
| Trigger | Query based or Rule based. | Query based |
| Trigger when | All rules or Any rule, shown with two or more rules. | All rules |
| Runs | How often the alert runs. | Daily |
| Day or Day of month | The weekday for a weekly alert, or the day for a monthly one. | Monday, or 1 |
| Time | The time of day, in 24-hour format, on the server's clock. | 09:00 |
| Email (under Schedule) | When emails go out. | When it changes |
| Roles and People | Who receives the email. | Empty, at least one required |
| Subject | The email subject. | [{{status}}] {{alert_name}} |
| Note above the table | Text above the rows. | Empty |
| Rows | Whether the email includes a table. | Include rows |
| Row limit | The number of rows in the table. | 10 |
| Which rows | Matching rows or First rows, rule-based alerts only. | Matching rows |
| Columns | The columns in the table. | Every column |
| Attach the rows as a file | The attachment type. | No file |
So it keeps working after its author leaves. The query uses the role's access, not yours.
An alert can read only the Lake and Warehouse data of its Runs as role. Ask an administrator to add you to the role that owns those tables, or change the query so it reads only that role's data.
The list shows only roles you hold. Ask an administrator to add you to the role, or ask them to create the alert.
Query based triggers whenever the query returns at least one row. Rule based triggers only when your rules match, for example a Row count greater than 100.
The column list fills from your last Test. Click Test first, or type the column name.
Only with Every match. With When it changes, you get one email when the condition starts being met and one when it is back to normal.
The server's clock. The editor shows the current server time under the time picker.
Yes, if you hold Notify Others With Alerts. Pick the team's role in Roles. Everyone in that role when the email goes out receives it.
No. Test runs the query and shows the verdict. Preview email shows the exact email the alert would send. Nothing is sent and nothing is saved.
The alert runs on that month's last day instead. Day 31 runs on 28 February, or 29 February in a leap year.
The bar reads Changed since this test - run it again and hides the rule results, and an open Preview email is out of date. Run Test again to refresh both.