Inspection Designer Manual

Inspection Designer Manual

 

Concept of the Inspections tool

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 Inspections 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.

001

 

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:

1_1 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

 

 

2_1 You take a look at the map that shows you the appointments for the day & plan your day

 

 

3_1 You call up the people to schedule times and off you go

 

 

4_1 You come to the first site and start the inspection questionnaire

 

 

5_1 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

 

6_1You 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.

 

7_1 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 Inspection Designer and how to manage them.

  1. Introduction to terms (Question, Question Group etc.)
  2. Creating a Questionnaire template
  3. Adding questions and defining their styles
  4. Adding question groups and separators
  5. Creating rules
  6. Enabling Inspections (Questionnaires) in Woodford
  7. Setting up Questionnaires in Woodford
  8. Working with Questionnaires in the application.

 

2.    Components (Static components and questions)

Main Components

Group – a collection of questions which have the same or similar relevance.

 

Static components

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.

 

Input components

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

HTML 

 

Component menu

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.’

Inspections_questions_section

 

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.

Inspections components section

 

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

Inspections question group

 

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 or On Change. 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.

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:

  • Cut
  • Copy
  • Paste
  • Delete
  • Deselect
  • Undo
  • Redo buttons

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 Inspections 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.

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 builder

To open the questionnaire builder using MS Dynamics CRM, go to Settings and in the available items menu choose Inspections and open the Builder.

 

Opening the questionnaire builder in the Resco Cloud management console is pretty much the same. You just need to have the corresponding URL for both ways. Then go to Settings and choose Inspections. Settings can be found in the Customize section. Use “+” button to create and add a new questionnaire template.

004

 

 

7.    Questionnaire builder’s basic layout

User can filter the existing questionnaires between displaying the recent ones, all, published, deactivated or drafts.

Inspections inspection builder

 

There’s also an option to switch between the default grid layout into the list layout.

Inspections grid list

 

Use ‘+’ button to create and add new questionnaires.

By creating a new questionnaire, you are going to define a new Questionnaire Template.

 

Questionnaire Template is a list of questions without values (answers) that are displayed to the user after opening a questionnaire. After filling out(answering) the questions, the answers are stored in their separate form, while questionnaire template stays available empty for future answers.

User is also able to Import or Export the templates, delete, clone, edit, deactivate, publish and associate the selected template.

 

Import  By clicking on the Import button, user gets a popup file explorer window to select the Questionnaire Template to be imported.

Export – User can export any selected template by clicking this button.

Delete – User can delete the selected template with this button.

Clone – Clone button provides an option to duplicate the selected template.

Edit – Clicking on the Edit button opens the selected template for the user to make changes in the chosen template.

Publish – This button is visible only if the selected template is deactivated or a draft. In this case it replaces the Deactivate button. By clicking this button, user sets the template’s state to “Published”. Published templates can be filtered out in the app view.

Deactivate – Deactivate button is visible only for the published templates. With it, user can set the selected template to be deactivated. Similarly to the published status, user can filter out deactivated templates in the app view.

Associate – Clicking on this button will open the Associate Questionnaire Dialog where user can add entities to associate the selected questionnaire with.

 

 

8.    Creating a questionnaire template

8.1. Questionnaire editor section

After opening Inspection Designer, a home screen for questionnaire templates shows up.  It is possible to switch between the existing questionnaire templates by using available views – recent, published, drafts, deactivated and all items.

Use ‘+’ icon in the header tool bar or ‘New Form’ button displayed in questionnaire list view section to create a new questionnaire template.

Subsequently the Questionnaire Editor is opened. In the header of the editor, choose what action to perform by clicking on one of the following buttons available within Edit, Organize and Rules section.

Edit section

  • 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

 Organize section

  • Move Up – Moves up the selected component
  • Move down – Moves down the selected component
  • Collapse All – Collapses all components
  • Expand All – Expands all components

Rules section

This section has two different variants.

1) In case a Group is selected:

  • 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
  • Edit On Delete

2) In case any other component is selected:

  • 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

 

8.2. Adding components on the questionnaire template

When creating a questionnaire template, you have a wide variety of components to use. 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.

Inspections adding components

 

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

Once the focus is on a component of the questionnaire template, component properties bar is shown on the right side of the editor.

Component property bar 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.
  • 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.

Inspections component properties

 

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.

Inspections adding question group

 

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:

Steps group

This group provides user with a way to add a new step, say text, add a variable or shared variable to the rule.

Inspections steps group

 

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.

 

Conditions group

This group contains the available conditions that can be used in the rules: If, Else, Condition, Group And, Group Or and Ungroup.

Inspections conditions group

 

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.

 

Organize group

Organize group provides user with option to reposition the components and collapse/expand them.

 

Move Up  Moves the selected component up.

Move Down – Moves the selected component down.

Collapse All – Collapses all components and hides their details.

Expand All – Expands all components.

 

There is also a different way to expand or collapse the component. User can either click on the +/- next to the component in the Questions side bar or click on the arrow button that’s on the component.

Inspections expand collapse

 

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:

Inspections rule examples

 

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.

 

Example:

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:

  1. Open the On Load Rule editor on the questionnaire.
  2. 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  

  1. Save the rule, questionnaire, and test it in the application.

 

Inspections required fields

 

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.

018

 

9.2.2. How to automatically assign values to certain fields (On Load Rule)

Example:

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:

  1. Open On Load rule editor on a questionnaire.
  2. 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

  1. Save the rule, questionnaire, and test it in the application.

Inspections onload example

 

This rule ensures that desired data is automatically filled in the questionnaire. “Filled by” field is filled in automatically.

020

 

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.

  1. Open On Change rule editor on a questionnaire
  2. 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).

Inspections enable questions

 

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.

 

10.    Permissions

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. In Woodford, choose Inspections on the list of features and entities and enable it.

025

 

Note: New (presented) Inspections Designer with additional features like automatic Dashboards etc is available in Woodford version 11.1 or higher.

Then Questionnaires can be added to the app’s Home section. Choose Home and add Questionnaire from available items on Home.

026

 

12.    Working with Questionnaires in the application

After opening Questionnaires in the application, a list of questionnaires (including templates and completed questionnaires) is visible. To show a more clear-cut summary, see how to create separate views for templates and for completed questionnaires.

027

 

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.

 

12.1. Create separate views for questionnaire templates and answered questionnaires

By default, all questionnaires (templates and completed ones) are visible after clicking on the Questionnaire entity. To be able to distinguish between those which are answered and those which are templates, two separate views can be created in the Questionnaire entity. One view for the templates and one for answered questionnaires.

Step by step:

  1. Choose the Questionnaire entity from the entity list in Woodford.
  2. Select Views and click on the “New” button to add a new view (create 2 views).
  3. Rename each view so it is clear whether it is for templates or answered questionnaires.

028

 

  1. Open the view and edit its filter:
    • for templates – add condition “Is Template equals True (Yes)”
    • for answered questionnaires – add condition “Is Template equals False (No)”

029

 

  1. Once you have both views created, save the changes, publish and sync the application.
  2. Open the Questionnaire entity in the application. Under the Questionnaire Label, it is now possible to switch between your created Views.

030

 

Additionally, you might want to ensure that only published Questionnaire templates are displayed in the ‘Questionnaire Templates’ view. The information whether a template is published or not (and in general what is the state of the template) is stored in the ‘Status Reason’ field on the Questionnaire entity.

Therefore, you can add one more condition into your ‘Questionnaire Templates’ view – the ‘Status Reason’ should equal ‘Active’ (which corresponds to Published). If you prefer to have also other Templates (drafts or deactivated) displayed, you can omit this step or include other values as well.

answered logic

 

12.1.1 Distinguish partially answered (saved) questionnaires and completed questionnaires

In the mobile app, it is possible to save the Questionnaire with information only partially filled in – which is particularly useful for large questionnaires. Once all the data has been filled in, the Questionnaire can be validated and completed.

Based on your use case, you might want to use this information and create views for answered questionnaires which are completed or the ones which are answered only partially.

Again, there is a handy field on the Questionnaire entity called ‘resco_completionstatus’. This field is empty for all the questionnaires that have been filled in (partially, not at all, or even fully), saved, but not completed. Once the questionnaire has been successfully completed, this field will hold the value ‘1’.

To create a view that shows only completed questionnaires start as in the previous chapter (create a view where Is Template equals No) but add one more condition with ‘resco_completionstatus’ equals ‘1’.

partially answered

 

12.2. Use Questionnaires on a specific entity

To be able to show Questionnaires for a certain entity, you must place the Questionnaire list on the entity view.

 

Example:

Choose an entity in the Woodford entity menu -> open its edit Form -> click on Add List -> choose Unrelated Entity list – Questionnaire ->Questionnaires List (*)

Once Questionnaire List is set on edit form, after opening the form in the application, Questionnaires are available as one of the tabs. If you click on the Questionnaire tab on the form, you will see all the Questionnaires available to the user – both templates and filled questionnaires (with answers).

It is possible to rename the tab using “rename” button.

031

 

12.2.1. Show only questionnaire templates on certain entity

To show only Questionnaire templates in the Questionnaire tab on entity – double tap on the Questionnaires List to open its properties and select only Questionnaires – Templates view.

032

 

Note: It is not recommended to create an edit form for Questionnaire entity. If you do so, the questionnaire mechanism won’t display questionnaire templates correctly once they are used as tabs (unrelated lists) on other entities.

 

12.2.2. Automatically relate questionnaire with entity records

To set up a relationship between the entity record and the questionnaire, we need to have a question type – Lookup – specified in the Questionnaire.

Inspections entity records

 

To automatically relate the record with the questionnaire, set up an OnLoad rule to assign the ID of the record to the Related to (Lookup) field.

034

 

In the application, when opening the entity and choosing the questionnaire, the record will be automatically related.

035

036

 

13.     Show completed Inspections on a specific entity

In the previous section, we described how to create a tab on an entity with questionnaire templates. And you can also show completed questionnaires for a specific record on its form.

037           

 

Example case:

We have a questionnaire in which it is necessary to choose an account record from the Account entity. This indicates that answers are related to this specific account and it is useful to display the questionnaire on the form of that record.

  1. Make sure the “Lookup” question type is set for the entity in the questionnaire, so users can choose the entity record. You can also set up automatic filling of this field when opening questionnaire from the entity record (see section 12.2.2 Automatically relate questionnaire with an entity record ).
  1. Add Unrelated List (Questionnaire) to the Edit Form of the entity (Account). Press F2 or use the Rename button to rename the list to “Completed_Questionnaires” or similar.

038

039

 

  1. Double-click or use the Properties button to open the Completed_Questionnaires list properties.
  2. Select only the view used for showing completed questionnaires.

Note: Check how to create separate views for questionnaire templates and completed questionnaires in section 12.1 Create separate views for questionnaire templates and completed questionnaires

040

 

  1. In Properties, click on the Edit Filter button and set up a filter.

Add the Link to Questions entity, and add a condition stating that only questionnaires with raw ID value that is the same as the value of the record should be displayed.

041

 

  1. Open OnLoad rule on the entity to ensure that every time the form is loaded, the tab with completed questionnaires is “refreshed” and visible.

042

 

  1. Save all the changes, publish and test it in the application.

 

14. 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.

associate

 

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.

Associate many to many

 

Associate dialog

 

14.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.

Associate entity

 

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:

Associate 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.