Mobile field inspections are one of the most common work assignments for a mobile worker.
The inspection process can be divided into four areas – planning, scheduling, executing and reporting.
In this document we will cover the planning and execution part. To streamline the inspection execution Resco developed a tool called Questionnaire Designer. This web-based tool enables users to build questionnaires in a data-driven UI. It utilizes a per-record architecture (not per-entity), so you don’t need to work with metadata when creating questionnaire forms – no need to have system admin access privileges and mess around with potentially risky data scheme changes.
Instead, any skilled user can design one-of-a-kind questionnaires and select the best from the wide variety of available question types: Inspectors can be asked to fill out checkboxes, select picklists, scan barcodes, take and edit photos, and much more. Conceptually, this list of questions serves both as a guidance for workers and a control tool for checking the process of inspection.
You can set up a custom business logic for your questionnaires, utilizing questionnaire rules. Once your questionnaire is ready, you can instantly deliver it to your field team via the app.
Simple scenario: Insurance claim agent
Let’s say that you are a car insurance agent–here’s how your typical inspection would go with a mobile CRM application:
You get a list of inspections for the day assigned via application – no need to call the office or go there personally to pick up the schedule
You take a look at the map that shows you the appointments for the day & plan your day
You call up the people to schedule times and off you go
You come to the first site and start the inspection questionnaire
You inspect the vehicle— it appears to have damaged headlights caused by a crash, so you answer “Yes” to the question “Is the car damaged?” Immediately after, a new window appears, asking you to snap a picture of the damage
You finish the questionnaire and try to send the claim to the back-office for processing, the app reminds you to ask the car owner for a signature that verifies the results of the inspection. Done.
The report is saved and automatically stored in CRM – now others can follow up on it, whether it’s your superior who needs to approve it, or the finance department that’s going to reimburse the customer.
1. What is a questionnaire?
Questionnaire is the main tool of Inspections scenarios. It is a structured form consisting of set of components or question groups designed to collect, manage and store data (information) on specific topics from users.
Generally, a questionnaire is the data collecting technique that serves for:
Fieldwork operations – provides instructions and collects feedback from respondents.
Communication purposes – collects information about various issues and topics as a first-hand communication channel with respondents.
The following chapters will describe all parts of the Questionnaire Designer and how to manage them.
Introduction to terms (Question, Question Group etc.)
Creating a Questionnaire template
Adding questions and defining their styles
Adding question groups and separators
Enabling Inspections (Questionnaires) in Woodford
Setting up Questionnaires in Woodford
Working with Questionnaires in the application.
2. Components (static components and questions)
Group – a collection of questions which have the same or similar relevance.
Description – adds a section for describing questions, questionnaire sections or for providing any other information for user, other than a question. It consists of a label and a description part and can be used as a separator component.
Link – adds a static link
Entity Link –adds a section with a static link on an entity record. It is possible to set the label, description of a section and label for the link. Clicking on “Click to select…” opens a window where an entity and its record that is going to be linked, is set. A typical use case for this component is to provide additional documentation (manual, scheme, or legal information) for a question.
Image – adds a section with a static image on a questionnaire template. It is possible to set the label and description of the image.
Text – adds a question type of a Singleline text on a questionnaire template
Multiple Lines of Text – adds a question type of Multiline text on a questionnaire template
Single Choice – adds a question with multiple answer options on a questionnaire template. User can only select one of the available answers
Multiple Choice – adds a question with multiple answer options on a questionnaire template. User can select multiple available answers.
Whole number – adds a question that requires a whole number as an input. The number has to be in between the minimum and maximum limits if they are set.
Decimal Number – adds a question that requires a decimal number as an input. The number has to be in between the minimum and maximum limits if they are set. User can also specify precision for the input that represents the number of decimal digits.
Check Box – provides user with a switch between two values. User can set the label for each.
Option Set – it’s similar to the Single Choice component, but each label has also a set index, according to which it can be searched.
Date – adds a field on questionnaire template to enter date data.
Date and Time – adds a field on questionnaire template to enter the date and time
LookUp – adds a field on a questionnaire that serves as LookUp on entity/entities. User creating template has to select target entities. Records of those entities will be then available in the application for user to select.
Image – adds a question that requires a picture as an input. Image is stored as Note image.
Signature – adds an input for the signature. Signature is stored as Note image.
Email – adds an input for the email address.
URL – adds an input for a specified URL.
Barcode – adds a way to scan a barcode
Component menu is divided into two sections – Questions and Components.
Questions section displays all the actual components placed on the questionnaire template. It is possible to easily and quickly switch between components on the questionnaire template by selecting them in questions menu.’
Components section provides access to and easy usage of all the available components for questionnaire templates. Components are divided into 3 sections – main, static and input components.
3. Question group
Question group is a collection of questions. Typically, it is used to categorize questions by relevance. Moreover, each question group can be set up as repeatable.
Instead of creating a questionnaire with the same set of questions multiple times, repeatable question groups offer the ability to repeat the grouped questions either arbitrarily (not known beforehand) or precisely specified number of times.
Repeatable question groups are useful in cases such as when:
user needs to enter multiple addresses
user needs to enter data about more than one result of the same issue (checking 10 identical parts of a machine),
user needs to enter multiple pictures of the same object
4. Questionnaire rules
Questionnaire rules describe sequences of steps that are executed when the user is filling out the questionnaire. The rules are triggered by the following events: On Load, On Save, On Change, On Repeat, and On Delete These steps allow us to further customize the questionnaire form’s design and usage (hide or disable form fields, assign values to them, etc.). To create a rule, open a Rule Editor by clicking on the corresponding event button.
On Load rule is executed when the user starts to fill out the questionnaire.
On Change rule is executed each time a value of a question is changed by the user.
On Save rule is executed when user completes the questionnaire.
On Repeat rule is executed when a repeatable group is repeated.
On Delete rule is executed when a repeatable group is deleted.
You can create rules on group level (for a particular group of questions) or on questionnaire level. Depending on your selected component, some events might be unavailable.
All rules can be defined and set using the main rule buttons – these are divided to “Add” and “Action” buttons.
Add section consists of:
Add step – tell the application what step to perform with the selected entity
Add condition – specify conditions that need to be met to perform or not to perform the desired steps.
Add variable – create a variable that is going to be used in the rule.
Add shared variable – add a variable which covers the entire questionnaire form
Action section consists of:
These buttons perform actions on the selected sections of the rule.
5. Questionnaire entities
Questionnaire entity – main parent entity. Records of this entity define either the template or the result – answer, depending on the IsTemplate field. Result records will have a lookup pointing back to the template record. Template records are created in the Questionnaire Designer, result-records are created when the user fills out the questionnaire in the Mobile CRM app. Each time a questionnaire is filled out a new clone of the template (along with all the questions) is created.
Group entity – a collection of questions. Can be repeatable.
Question entity – this entity contains the definition of the question. That is the name, the position, type and all other parameters. When the user is filling out the questionnaire, the question records are cloned, and the answers are saved in the cloned record.
6. Questionnaire Designer
To open the designer using MS Dynamics CRM, go to Settings and in the available items menu choose Inspections and open the Builder.
To open the designer in the Resco Cloud management console is easy. Log in to Resco Cloud and select Questionnaire Designer. Settings can be found in the Customize section. Use “+” button to create and add a new questionnaire template.
7. Questionnaire Designer’s basic layout
The designer main screen shows a list of your questionnaire templates. If you have many templates, you can use the left menu to filter the entries. You can also access snippets here.
The bottom right corner has a pair of buttons that allow you to switch between grid layout (default) and list layout.
The main toolbar offers the following functions. The toolbar does not change for questionnaires and snippets, though not all functions are available for snippets.
Create a new questionnaire template or snippet from scratch.
Select a .qbuilder file and import it.
Export the selected questionnaire or snippet in XML format (.qbuilder file).
Select one or more of the sample questionnaire templates and import them.
Permanently delete the selected questionnaire template or snippet.
Create a copy of the selected item. You are prompted to enter a new name for the duplicate.
Open the selected item for editing.
Mark a questionnaire template as active. Active questionnaire templates can be used in the mobile apps. Only available for questionnaire templates in inactive or draft state.
Mark the selected questionnaire template as inactive.
Use this function to add or remove entities to which the questionnaire should be associated.
8. Creating a questionnaire template
8.1. Questionnaire editor
Create a new questionnaire or edit an existing one to open the questionnaire editor.
Main toolbar is in the top section of the application. These are the commands available on the main toolbar.
Save – Saves the questionnaire
Save & Close – Saves the questionnaire and returns user to the home screen.
Clone – Clones/duplicates the selected component
Delete – Deletes the selected component
Move Up – Moves up the selected component
Move down – Moves down the selected component
Collapse All – Collapses all components in the central pane and in the Questions pane
Expand All – Expands all components in the central pane and in the Questions pane
Multiselect – Allows you to select multiple components (you can also hold Ctrl to select multiple components). You can use the selection for example to create a snippet.
Create Snippet – Snippets are parts of the questionnaire template that you save separately for later reuse. Select multiple components (for example using the Multiselect button), then click Create Snippet and specify a distinct name. You can insert saved snippets into the same template or into a different template. Snippets can include questions and/or groups.
Edit On Load Rules – Rules executed when the user starts filling out the questionnaire
Edit On Save Rules – Rules executed when user completes the questionnaire
Edit On Change Rules – Rules executed each time a value of a question is changed by the user
Edit On Repeat – Rules executed each time a repeatable group is repeated (only for groups)
Edit On Delete – Rules executed each time a repeatable group is deleted (only for groups)
Use Styles to modify how the questionnaire appears in the app. You can change for example text color, alignment, position of questions and answers, etc..
8.2. Adding components on the questionnaire template
When creating a questionnaire template, you have a wide variety of components to use, available on the Components pane. As described in previous sections, components are divided into main, static and inputs components.
Group (Question Group) is the main component that serves as “storage” of questions belonging to one logical group which also can be repeatable on one questionnaire template. To find out more about Group check section 3. Question group.
Static components are designed to show static text, images, links or entity links. These components cannot be changed by user filling the questionnaire template.
Input components are components used to set up questions of many kinds. To find out more about each type of components please check chapter 2. Components (Static components and questions).
To add a component on a questionnaire template, please use ‘+’ icon in the right corner of each component tab in component menu.
Note: To replace the component on the questionnaire template, please, use the “Select&move” button in the left upper corner of each component and drag and drop it to the required position.
8.2.1. Component properties
When you select a component in a questionnaire or snippet, properties of the component are displayed on the right side of the editor.
The properties pane displays the main information about the component and options for user to choose when setting a question.
Basic properties are:
ID – each component has its own unique ID. User can’t change it.
Name – user can edit the displayed name for any component however it can’t be changed after saving the questionnaire
Style – user can choose from the offered component styles
Properties to select can be:
Required – when enabled, component is mandatory.
Show on report – when enabled, component is visible on the report
Visible – when enabled, component is visible.
Format – some components offers the additional option to select desired format.
Repeatable – property of question group, which defines min and max possible number of repeating the group.
8.3. Adding a question group
Add Group component from the components menu on a questionnaire template by clicking on ‘+’ icon. Start with the label and description of the question group. Both of them help users to identify question group sets and understand their concept. You can also use the description to provide instructions to users – for example, how many questions need to be filled out in a question group.
The main advantage of these groups is the option to set them as repeatable. Number of repetitions is manageable by defining the Minimum and Maximum repeat instances. If these are left blank the repeat instances are undefined and it is possible to save the questionnaire with any number of finished questions groups.
“Copy values when repeating group” is an efficient tool when most of the entered values are the same as in the previous questions.
Individual questions have numerical indexes, question groups have alphabetical indexes and are sorted alphabetically.
Question groups are always displayed after the questions with numerical indexes. It is not possible to re-position question groups, only sort them by changing their alphabetical index. E.g. It is not possible to put the question group B between questions with indexes 2 and 3, but it is possible to place the question group B instead of question group A, changing its position within the question group section.
9. Rules in questionnaire template editor
9.1. Add buttons in rules
This group provides user with a way to add a new step, say text, add a variable or shared variable to the rule.
Add Step –Step is a specific action which can be defined within the condition branch or separately in the rule. Once it is a part of the condition branch, the step begins after its preceding condition is met. To move a step in the rule editor use arrows in the editing line. To delete it, use the delete button in the same line.
Add Say Text –When the rule condition is fulfilled, a message window with chosen text appears on the user’s screen. This button serves as means of setting the message text.
Add Variable –By clicking “Add Variable” step you can define a variable that is added into the Property Selector of the rule. This variable will be only used for the specified rule. Remember that you can only use this variable after the step where it was defined. To enter a variable into the workflow after defining it, just click elsewhere the variable editor. To delete it, click on the variable and choose the delete option in the editing line.
Add Shared – By clicking “Add Shared” step you can define a shared variable that is added into the Property Selector of the rule. This variable can be also used for other rules.
This group contains the available conditions that can be used in the rules: If, Else, Condition, Group And, Group Or and Ungroup.
Add If – The first condition contains label “If” and the condition string. Conditional branch consists of the condition and steps that are executed only when condition is valid. Steps and variables are displayed in the “Then” or “Begin” section. All parts of the rule can be modified or re-ordered using the up and down arrows at the end of the editing line.
Add Else –Using this option, otherwise branch of the condition will be added to the actual (selected) condition. Otherwise part of the rule condition prevents user from experiencing unexpected, incorrect behavior.
Group And –Button joins selected conditions with the logical AND sign.
Group Or –Button joins selected conditions with the logical OR sign.
Ungroup –Selected condition consisting of several conditions is divided into separate conditions.
9.2. Rule examples
In this section, the rules are explained on examples which can be useful when setting up new questionnaire templates. All the rules are set for the following questionnaire template:
9.2.1. How to make answer fields required in questionnaire
Using the Answer Required option when editing a question is a practical tool if we want to ensure that user has to write in some data to be able to save the questionnaire. But to make it even clearer, we can set up a rule, that will highlight the question in red and show an error message to the user, in case he doesn’t fill out the answer field of a question.
We want to show the message “Please answer “Have you ever used the Resco CRM application before?”, if the user doesn’t answer the question #2 from our example questionnaire:
Open the On Load Rule editor on the questionnaire.
Set up a rule with the following logic:
Add Condition -> If the question (Have you ever used Resco CRM before) doesn’t contain data
Add Step -> assign error message to this question stating what we want to say to the user
Save the rule, questionnaire, and test it in the application.
The changes are applied in the application. The question is highlighted in red while editing the questionnaire. Once the user is trying to save it without having answered the question, error message pops up and prevents him from saving the questionnaire.
9.2.2. How to automatically assign values to certain fields (On Load Rule)
If user chooses the questionnaire and opens a new (empty) template, date, time and his name will be automatically added. To achieve this, create a similar rule:
Open On Load rule editor on a questionnaire.
Set up a rule with the following logic:
Add Condition -> If a questionnaire Is New
Add Step-> for question Date and Time – set Now as a value
Add Step -> for question Filled by: – set Configuration.username as a value
Save the rule, questionnaire, and test it in the application.
This rule ensures that desired data is automatically filled in the questionnaire. “Filled by” field is filled in automatically.
9.2.3. Enable/disable questions based on values in other questions (On Change Rule)
It is a quite common request to hide/show a question based on the answer to the previous question in questionnaires.
Here is a simple example showing how to enable a question if a certain value is entered. Imagine that you have a question which must be disabled by default because you don’t want users to answer it unless they answer “Yes” on a previous question.
Open On Change rule editor on a questionnaire
Set up a rule with the following logic:
Add condition -> stating, that the step part will be executed if changed item (the changed field) equals the preceding question (question which must have a specific value – yes – to show the next question)
Add step -> stating that question is only visible, if the preceding question has a value.
Note: It is possible to create such a rule if the preceding question type is Boolean. Therefore, by the value in the step we mean the “ON” option of the Boolean (index 1).
Note: Is Enabled option ensures that the user can provide an answer for the question. If you want to hide the question use Is Visible.
Permissions for Inspections entities (Question, Question Groups, Questionnaire) need to be set based on what action will the user perform on questionnaires.
For Questions and Question groups, users – administrators – managers, who create and fill out questionnaires, should have a Read and Create permission (enable the Update permission only if it admins will need to modify questionnaires later).
User (a person who is filling out the questionnaires)
Read permission – required for owned records and records owned by the manager that creates the questions (e.g. Business unit level).
Create permission – is needed so the user can answer questionnaire templates and save the completed questionnaires.
Update, Delete permissions – users may not have these permissions unless they’re creating questionnaires themselves.
Manager (a person who us creating and filling out questionnaires, and gathering info)
Read permission – necessary for owned questionnaires.
Create, Update, Delete permissions – required at least for owned questionnaires. Delete permission is upon consideration.
Note: If you want to enable viewing and updating all questionnaires available on the server for all managers, these permissions need to be set rather for a business unit.
It is also possible to manage permissions by assigning ownership of Questionnaires to teams in the CRM backend.
11. Enabling and setting up questionnaires in Woodford
Questionnaires are a part of the Inspections feature and are available in Woodford 10.2 or newer. To see it in the application, use the Resco Mobile CRM app, version 10.2.1 or higher. For most features, use the latest version.
To enable Inspections in Woodford:
Edit an app project.
Select Inspections in the Project menu.
Check Enable Inspections and click Save.
You can integrate Inspections with your project in a few clicks:
To add Inspections to your Home screen, click Add to Home.
To add Inspections to a Form, click Add to Form.
To install a pre-configured automatic report, click Install Report.
12. Working with questionnaires in the application
When you open Questionnaires in the application, a list of questionnaire templates is displayed. You can use the drop down list and select a different view:
In progress or completed
Once the questionnaire is filled and saved, copy of the initial template is created with all the answers and stored as a separate questionnaire. Users don’t make changes on the original questionnaire, since it is used as a template for future inquiries.
It is not possible to have two questionnaires opened at once – the user can work with one questionnaire at a time. To fill out another questionnaire, the user must save and close the questionnaire or discard changes and close it.
13. Association of questionnaire templates to entities
A typical use case expects a certain type of Questionnaire(a template) to be available for certain situations and not in others. For example, you might have different types of Appointments – an Inspection, a Repair … and therefore you might want to display different Questionnaire Templates for an Inspection Appointment and different templates for a Repair Appointment.
To capture this in Resco Inspections, we have introduced an option to Associate a Template. The general idea is that you can use many to many relationships to associate a Questionnaire to an entity. The many-to-many relationship connects the Questionnaire Template to the actual record, so this defines which template belongs to which records.
The Associate dialog – which you can open after selecting a template in designer and hitting ‘Assign’ in the top ribbon – lets you create the instances of this many to many relationships to create the actual connections. If you haven’t worked with many to many relationships before, or they don’t exist in your type of CRM system you can think of them as entities with two lookups – one to Questionnaire entity and the other lookup to any other entity of your choice. The Associate dialog creates a record of this many to many entity and fills in the lookups.
Please note that this many to many relationship entity has to exist in your metadata (so these entity types have to be created in your system) in order to see and create them in the Associate dialog.
13.1 Examples of questionnaire association
The simplest example of association of a Questionnaire Template would be direct association of a Questionnaire to a record. You can have Tasks that your users have to complete every day and you might have a manager that defines which Tasks have associated which Questionnaire Template.
The manager opens Resco Inspections and the Questionnaire Designer every week, and uses the Associate dialog to associate the corresponding Templates to corresponding tasks.
For this a many to many relationship ‘Task Questionnaire’ exists in the metadata, where one of its lookups has the ‘Questionnaire’ entity as the target and the other lookup’s target is the ‘Task’ entity. After clicking ‘Add’ in the Associate dialog, the manager is presented with all the Tasks in the system, to create the association (many to many relationship record) between the selected Task and the Template.
Creating the relationship record is not enough though, the relationship needs to be reflected in the views used in the mobile application, otherwise all Templates (and not only the associated ones) will be visible. So, after completing the steps from section 12.2 on the Task form we need to add some more filters on the Questionnaire Templates tab. Double tap the tab again, and insert (add after the already present) following filter:
The general idea is that you need to Add a Link to the many to many relationship (‘Task Questionnaires’) and add one more link to the Tasks to it (to the Task Questionnaires link). Finally, we add a condition asking that the Task’s Id should equal to the Id of the Task on the form, which we can do by clicking onto the editor part of the condition and selecting ‘Set Variable’ from the top ribbon. Once the window opens, select the Task’s Id (primary key) and you should be done. Now only the Questionnaire Templates that have been associated to the current Task (Task on the form) should be displayed in the list!
Of course, this approach is a bit cumbersome – the manager has to associate each and every task, which can be time consuming. Clever approach is to create one more entity, representing the type of the Task or Appointment and associate the Templates with this entity.
For the sake of clarity let’s use the example from the beginning of this chapter. You have two types of Appointments – an Inspection and a Repair. Therefore you want to display different Questionnaire Templates for an Inspection Appointment and different templates for a Repair Appointment.
For that, you create an entity ‘Appointment Type’ and create two records in the Appointment Type – ‘Repair’ and ‘Inspection’. You also create a lookup field on the Appointment entity to the Appointment Type, where the selection would indicate the type of the Appointment.
Then you use the associate feature to associate templates not to the Appointment entity, but to the Appointment Type. With a little adjustment to the view filters you can then see only the Templates associated to the corresponding Appointment Type on the Appointment form.
For a more comprehensive example, check out this blog post.