Connecting to Connected Field Service

Completed

Now that you have built an Azure IoT Central application let's look at how we can connect that up with Connected Field Service. To accomplish that we are going to use the Power Automate connectors to register devices and raise alerts with Dynamics 365.

Power Automate

Typically, with a Connected Field Service solution you would create the customer asset and then register the device. You can accomplish the same task using Power Automate by creating a selected record flow. This means either you select the customer asset from the list or run the flow from a specific customer asset record. The flow will use the IoT Central connector to register the device with IoT Central (and also with the embedded IoT Hub instance). The following is the flow you will build in the next unit to do the registration.

Screenshot of a Power Automate flow you will build in the next unit.

Notice in addition to updating the customer asset with the Device ID, you will also be creating the IoT device record, which is used if you send any commands or other actions from Dynamics 365.

Once you have the device registered you have created a connection between the device in IoT Central and the customer asset in Dynamics 365 Field Service. To continue our scenario of a smart trash container, in the prior module we set up an event to indicate the container was ready for pickup. Now let's look at how we can raise an alert into Dynamics 365 so it could be scheduled for pickup.

Rules

To start the process, we are going to use the rules feature of IoT Central. Rules are built to monitor telemetry of the device and perform an action when a condition is met. In addition to looking at the real-time values, rules can also look at device properties. For example, the properties might include threshold information that varies by device based on the installation. The following is an example of the rule you will build to react to the ready for pickup event. Notice there are several options for actions when a rule condition is met. We will be using the Microsoft Flow (Power Automate) action to create an IoT Alert record.

Screenshot of Configure Event Rule screen with Microsoft Flow action highlighted.

To create the flow, you will be again using the IoT Central flow connector that allows building a flow that is triggered by a specific rule in IoT Central. The flow itself is simple, it matches the customer asset using the device ID that triggered the flow. Then an IoT Alert record is created for each of the matching assets.

Screenshot of flow triggered by a specific rule in IoT Central.

With the IoT Alert created it can then flow into the normal business process capabilities of Dynamics 365 Field Service, including scheduling a visit to the location. In the next unit, you will be adding device registration and raising of alerts to your IoT Central application you built in Unit 2.