Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article shows you how to create an alert on a Warehouse SQL query. When you create an alert on a SQL query, an alert is raised when the query returns results. If the query doesn't return any value, no alert is raised.
Create an alert rule
In the SQL query editor of a Warehouse SQL query, enter and run a SQL query, and then select Create rule on the ribbon.
Note
The SQL query must be a SELECT query.
Continue to the next section to start creating a rule.
Details section
On the Add rule page, in the Details section, for Rule name, enter a name for the rule.
Monitor section
- In the Monitor section, for Source, confirm that the source is set to the table on which you ran the query.
- For Query, confirm that you see the query you ran in the SQL query editor. To see the full query, select Show more.
- For the Run query every field, select the frequency at which the query should run to check the condition.
Condition section
For the Check field, confirm that On each event is selected. This setting means that the alert is evaluated every time the query runs.
Action section
In the Action section, select one of the following actions:
To configure the alert to send an email when the condition is met, follow these steps:
For Select action, select Send email.
For To, enter the email address of the receiver or use the drop-down list to select a property whose value is an email address.
For Subject, enter a subject for the email.
For Headline, enter a headline for the email.
For Notes, enter notes for the emails.
Note
When entering subject, headline, or notes, you can refer to properties in the data by typing
@or by selecting the button next to the text boxes. For example,@BikepointID.For Context, select values from the drop-down list that you want to include in the context.
Teams message
To configure the alert to send a Teams message to an individual or a group chat or a channel when the condition is met, follow these steps:
For Select action, select Teams -> Message to individuals or Group chat message, or Channel post.
Follow one of these steps depending on the option you selected in the previous step:
- If you selected the Message to individuals option, enter email addresses of receivers or use the drop-down list to select a property whose value is an email address. When the condition is met, a Teams message is sent to specified individuals.
- If you selected the Group chat message option, select a group chat from the drop-down list. When the condition is met, a message is posted to the group chat.
- If you selected the Channel post option, select a team and a channel. When the condition is met, a message is posted in the channel.
For Headline, enter a headline for the Teams message.
For Notes, enter notes for the Teams message.
Note
When entering headline or notes, you can refer to properties in the data by typing
@or by selecting the button next to the text boxes. For example,@BikepointID.For Context, select values from the drop-down list that you want to include in the context.
Run Fabric activities
To configure the alert to launch a Fabric pipeline, dataflow (preview), notebook, or Spark job when the condition is met, follow these steps:
For Select action, select the appropriate Fabric item type within the "Run Fabric Activities" section
On Select Fabric item to run, select the Fabric item from the list.
For the Pipeline, Dataflow, Notebook, and Spark job types, select Add parameter and specify the name of the parameter for the Fabric item and a value for it. You can add more than one parameter.
If you selected Run function option, follow these steps:
For Function, select a function from the list.
For parameters to the function, specify values for each of the parameters defined for the function as shown in the following example:
You can use properties from the data by typing
@or by selecting the button next to the text boxes. For example,@BikepointID.
Custom action
To configure the alert to call a custom action when the condition is met, follow these steps:
For Select action, select Create custom action.
As mentioned in the Action section, create the rule first, and then complete the custom action setup by following steps from Trigger custom actions (Power Automate flows).
After you create the custom action, in the Definition pane of the rule, select the custom action from the Action drop-down list.
Save location section
In the Save location section, for Workspace, select the workspace where you want the Fabric activator item to be created or that already exists.
For Item, select an existing activator item or creat a new one. To create a new activator item, select Create a new item, and then enter a name for the activator item.
Create the rule
On the Add rule page, select Create to create the rule. After the rule creation is successful, it runs based on the frequency you set in the Run query every field. If the query returns results, the rule triggers the actions you set.
Rules pane
After the rule creation is successful, you see the Rules pane with the list of rules. In the Rules pane, you can perform the following tasks:
Use the toggle button to stop or run the rule.
Select ..., and select Edit to edit the rule, Delete to delete the rule, and Open in Activator to open the Fabric Activator item with the rule that was created.
Sample alert
Here's a sample alert Teams message that you receive when the alert is triggered: