Run reports on inspection responses
Create reports or dashboards, for example, in Power BI to analyze and act based on the inspection responses provided by technicians.
Understand, view, and report inspection responses
All responses entered for an inspection are stored in Microsoft Dataverse. Inspection responses can be parsed into individual question responses.
First, you need to configure how often inspection response should be parsed and organized in Dataverse.
To enable response parsing, go to Field Service app > Settings > Field Service Settings > Inspection tab.
Make sure Analytics enabled is set to Yes. For Analytics frequency, consider the following options:
- Daily: Use this setting for inspection responses to be parsed into individual question responses once daily. Every day on the Record generation start time, out-of-box flows are triggered to populate individual question responses into a Dataverse table.
- Immediately: Use this setting if you need question responses to be available in Dataverse as soon as an inspection is marked complete.
- Custom: Define your own frequency by providing the number of days when parsing should be done. See the following screenshot for an example.
Note
When analytics frequency is set to Immediately, the inspection response is parsed and persisted as soon as the service task is completed; the parsed responses won't be updated even if the technician makes changes and completes the inspection again. However, if the analytics frequency is set to Daily or Custom, the responses are stored from the latest completion of the service task before the flow start time.
Now that analytics are configured, questions and responses are ready to be saved into the three tables in Dataverse:
- Customer Voice survey question or msfp_question: stores each inspection question.
- Customer Voice survey response or msfp_surveyresponse: a response to an inspection.
- Customer Voice survey question response or msfp_questionresponse: each individual response to each inspection question.
Now we're ready to create and publish an inspection. See the following screenshot for an example.
Questions on inspections are stored in Dataverse, and can be found in the Customer Voice survey question table in Power Apps. Here, you can see entries for each question on an inspection.
Before any inspection is completed, the Customer Voice survey question response table is empty.
Back on our sample inspection, we added some responses for the questions, as seen in the following screenshot, and completed the inspection.
Checking again in the Customer Voice survey question response table, you see the values to each submitted response from the inspection.
Out-of-box flows
All the logic described in the previous section uses Power Automate flows, and comes with the inspections capability.
The following flows are involved:
Deserialization of Inspection Definition Flow: this flow gets triggered upon publish of an inspection and populates inspection questions into
msfp_question
table.Deserialization of Inspection Response – Recurrent Flow: this flow triggers when frequency is set to Daily or Custom and updates the parsed inspection response JSON into
msfp_surveyresponse
and creates new records for responses and corresponding questions in themsfp_questionresponse
table.Deserialization of Inspection Response Flow: this flow takes care of response parsing when frequency is set to Immediately.
The status of the flows can be checked as shown in the following screenshot.
Attachments or images within a response
Each image uploaded in inspections is stored as an annotation in the Inspection Attachments table. They can be retrieved using flows.
Configuration considerations
Use Power Automate flow to parse inspection responses (deserialization of responses)
When a technician fills out an inspection, the answers to each inspection question are stored as JSON in the Inspection Response entity.
Use a Power Automate flow to run a workflow on inspection responses. For more information, see the video on run workflows on Inspection responses.
In the following example, if a technician responds "Yes" to the inspection question "Is a follow-up required?" then a new follow-up work order service task is added to the related work order.
Note
Out-of-the-box flows cannot be customized. You must create or copy a Power Automate flow in order to customize it.
Create a flow
Go to https://flow.microsoft.com, sign in, choose your environment, and create a new flow.
Choose Automated - from blank.
Name the flow and select Skip to choose the trigger on the flow editor page.
Create a trigger
Search for "Dynamics 365" in Connectors and choose the trigger as When a record is created or updated.
This flow relates to the Work Order Service Task entity because technicians view and respond to inspections from this entity. Choose Work Order Service Tasks for the Entity Name.
Fetch the response from the database
Next, we need to retrieve the inspection responses.
Add a step using the Get record action in "Dynamics 365."
Choose Inspection Responses as the entity to get and Inspection Response ID in the item identifier because this field has the ID of the inspection response record.
Extract the JSON
Add an Initialize Variable action to retrieve the response from ResponseJsonContent field.
Decode the response
Now we need to convert the response's JSON into a usable format.
Add an Initialize Variable action to url decode and base 64 decode the response JSON:
decodeUriComponent(decodeBase64(variables('responseJson')))
Update the schema
Provide the schema with the name of the question you want to run a workflow on.
In our example, the schema is:
{
"type": "object",
"properties": {
"Followup": {
"type": "string"
}
}
}
If you're having trouble generating the schema, you can select the Generate from sample option and enter the name and sample answer of your inspection question and response.
In our example, we can enter:
{"Followup":"Yes"}
"Follow-up" comes from the inspection question's name value, as seen in the following screenshot:
Condition-based action
Next we add a condition and action based on the response to the inspection question.
In this example, we create a Work Order Service Task with another Service Task Type in the same work order when the "Follow-up" inspection question has "Yes" as the answer.
Save and test your flow.