Create a rule in Fabric Activator

Once you bring streaming data into an activator or assign events to objects, you can create rules to act on your data. The activation of those rules can be the sending of a notification, such as an email or Teams message. And the activation of those rules can trigger a workflow, such as starting a Power Automate flow.

Prerequisites

  • To successfully complete this how-to, you need a workspace with a Microsoft Fabric-enabled capacity.

Open Activator

Start by opening Fabric in your browser.

From the nav pane, select Create > Activator. If you don't see Create, select the ellipses (...) to display more options.

Select Try sample to create an activator that is prepopulated with sample events and objects.

Define a rule condition and action

Use Rules to specify the values you want to monitor in your events, the conditions you want to detect, and the actions you want Activator to take.

Select your rule data

In the Activator Explorer, select the property or eventstream to monitor in your rule. See Create properties later in this article for information on properties.

Once you select a property or eventstream, you see a preview of the values for a sample of the instances of the object.

Make a new Activator rule

To create a new rule, from the ribbon, select New rule. Give it a new name by selecting the default rule name and editing it. The Monitor section of the rule is prepopulated with the data that you selected in Step 1.

Screenshot of creating a new rule.

Define the condition to detect

Next, choose the type of condition that you want to detect. You can use conditions that check:

  • when a numeric value goes over or below a threshold (for example, temperature is greater than 30),
  • when a logical true/false value changes (for example, HasFault becomes True), or
  • when a string value changes (for example, Status changes from InCompliance).

Screenshot of choosing the alert condition.

The charts in the Definition tab updates to show a sample of the events that meet the conditions that you set.

Screenshot of a detect card showing two charts.

If you navigate to the Analytics tab, there are two charts. The first shows the total number of times the rule fired, for all object IDs that Activator is tracking. Use this chart to understand the volume of notifications that fired over all object IDs. The second chart shows the total number of times the rule activated, for the five object IDs. Use this chart to better understand if there were particular object IDs that contribute the most to all the activations that fire.

Define the action to take

Finally, use the Action section to choose what to do when the condition is detected.

Screenshot of selecting an action when a condition is detected.

Different action types have different parameters. Some of those parameters are: the email address you want to send to, the workflow you want to start, subject line, or additional information.

You can also select Edit action to see an editor with a preview of the message that the action sends and options to add more information to the action.

Test your rule

After you create a rule, test it by selecting Send me a test alert. Selecting this button finds a past event for which the rule activation is true and sends you an alert so that you can see what the alert looks like for that event.

  • The test alert always goes to you, regardless of the recipient field in the Action card
  • The Send me a test alert option is only enabled if you have at least one past event for which the rule condition is true.

Start and stop your rule

Rules are created in a Stopped state. This means they're not being evaluated as data flows into the system, and don't take any actions as a result. After defining the rule, select Save and start to make the rule active. If you're not ready to start your rule, save it and come back later. When you're ready, select Start from the toolbar for Activator to start running the trigger and taking action.

Screenshot of starting an alert.

Once started, you see Running in the title area of the rule card. Also, the icon in the Explorer shows that the rule is running. When you start the rule, new activations start running against new ingested data. Your rule doesn't activate on data that has already been ingested. To stop the alert, select Stop.

If you make changes to the rule (for example change the condition it looks for), select Update in the toolbar to make sure that the running rule uses the new values.

When you delete a rule (or object), it can take up to five minutes for any back-end processing of data to complete. Deleted rules might continue to monitor data, and take actions accordingly, for a few minutes after they're deleted.

Create properties

Sometimes, you need to reuse rule logic across multiple rules. Create a property to define a reusable condition or measure, then reference that property from multiple rules.

To create a property, select the stream added to the object that you're interested in and select New Property from the ribbon and then select the property you'd like to use in the rule logic.

Screenshot of creating a property for an alert.

Once you define a property, you can reference it from one or more rules. Here we reference the Temperature property Too hot for medicine.

Screenshot of package too warm property for an alert.

Clean up resources

Delete the sample eventstream by selecting the ellipses (...) to the right of the Package delivery events eventstream, and selecting Delete.

Next step