We are preparing a new source of documentation for you. Work in progress!

Questionnaire Designer

From Resco's Wiki
Revision as of 12:03, 6 December 2019 by Jzambor (talk | contribs) (Folders group)
Jump to: navigation, search

Questionnaire Designer, also called Inspections Designer is a web application that runs in a web browser. It is one of the main components of Resco Inspections that allows users to build questionnaires in a data-driven user interface. 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.

Questionnaires and snippets

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.

Sometimes, when the distinction is important, we use the term questionnaire template to denote the questions and set them apart from the answers. Use the designer to prepare the templates, then use the app to fill in the answers.

Snippet is a portion of a questionnaire that you can save separately. You can reuse them in the same questionnaire at multiple locations, or even in different templates. Snippets can include questions and/or groups. See this blog for tips how to speed up the setup of questionnaires using snippets. Blog

Life cycle of a questionnaire template

Over time, you might need to modify your questions. You have two options how to manage your templates.

Non-versioned templates
These templates have a simple life cycle. They start in draft status. You can then Activate them to make them available in the app, or Deactivate them to disable them. You can edit non-versioned templates at any point; it can happen that your app users manage to launch the questionnaire while you're in the middle of a change.
Versioned templates
These are useful if you expect more frequent editing of your templates and you want to avoid the potential pitfalls. Once you enable Versioning for a template, this process cannot be reversed. These templates also start in draft status. You have the option to Stage them, i.e. make them available in the app, but only for test users. You can Publish them to make them available for all users.
Once published, you cannot edit a template. However, you can Revise it to create a new version in draft status, while your app users continue to use the published version. Once you're happy with your draft or staged revision, you can publish it; moving the previous published version to archive. You can also access the version history and easily return to an older version of the template.
Lifecycle of questionnaire templates.png

Accessing the designer

Microsoft Dynamics CRM
Log in to Dynamics, go to Settings, and in the MobileCRM section, select Inspections. On the Inspections page, select Designer.
Resco Cloud
Log in to your organization and select Questionnaire Designer.
Salesforce
Log in to Salesforce, start the App Launcher, then select Questionnaire Designer. Requires Resco managed package.

Managing questionnaires

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.

Questionnaire Designer.png

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 (not all functions are available for snippets).

Actions group

  • New – Create a new questionnaire or snippet from scratch.
  • Edit – Open the selected item for editing.
  • Delete – Permanently delete the selected questionnaire, snippet, or folder.
  • Clone – Create a copy of the selected item. You are prompted to enter a new name for the duplicate.
  • Activate / Deactivate – Mark a template as active or inactive. Active templates are available in the app.
  • Associate – Use this function to add or remove entities to which the questionnaire should be associated. See also this blog post. Blog
  • Mobile Report – Start the Report Designer for the currently selected questionnaire template.

Data group

  • Import – Select a .qbuilder file and import it.
  • Export – Export the selected questionnaire or snippet in XML format (.qbuilder file).
  • Demo Data – Import sample questionnaires.

Versioning group

  • Versioning – Enable versioning for a template. This cannot be reversed.
  • Version History – Show a list of versions available for this template.
  • Publish – Make the questionnaire available in the app. Similar to Activate for non-versioned questionnaires. Published templates cannot be edited.
  • Stage – Make the questionnaire available for test users in the app. Staged templates can still be edited.
  • Revise – Change the status of a template to Draft (makes it available for editing). Available for published or archived versions.
  • Archive – Mark a published template as archived: This will make the template unavailable in the app.
  • Discard – Permanently delete current draft version.

Folders group

Use folders to keep your questionnaires organized.

  • New Folder – Create a new folder.
  • Rename Folder – Rename a folder.
  • Move To – Move a template or folder to a folder.

You can also click Delete in the Actions group to delete a folder including all templates and subfolders.

Note Folders only serve to organize templates in the designer; they have no impact on questionnaire availability in the app. To modify which questionnaires are available in the app, use the view filters.

Editing a questionnaire

Main toolbar

Main toolbar is in the top section of the application. These are the commands available on the main toolbar.

Publishing group
  • Save – Save the questionnaire
  • Save & Close – Save the questionnaire and returns user to the home screen.
  • Publish – Make a versioned template available in the app.
  • Stage – Make a versioned template available for test users in the app.
Edit group
  • Clone – Clone/duplicate the selected component
  • Delete – Delete the selected component
Organize group
  • Move Up – Move up the selected component
  • Move down – Move down the selected component
  • Collapse All – Collapse all components in the central pane and in the Questions pane
  • Expand All – Expand all components in the central pane and in the Questions pane
  • Multiselect - Allow you to select multiple components. You can use the selection for example to create a snippet.
Snippets
  • Create Snippet – Select multiple components (for example using the Multiselect button), then click Create Snippet and specify a distinct name to save it for later use.
Preview
  • Preview BETA – Preview the questionnaire in your browser. Rules are ignored in preview mode.
Rules group
  • On Load – Executed when the user starts filling out the questionnaire
  • On Save – Executed when user completes the questionnaire
  • On Change – Executed each time a value of a question is changed by the user
  • On Repeat – Executed when a new instance of a question group is created
  • On Delete – Executed when an instance of a question group is removed from the questionnaire
Commands group
  • Edit – Select which commands should be available in the app for users who fill out a questionnaire.
  • On Can Execute – Using rules, configure when a command is available.
  • On Execute – Using rules, configure what happens when a command is executed.
Styles
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.

Questions pane

The Questions pane shows a chronological list of components within a questionnaire, similar to a table of contents. Selecting a component in the Questions pane also selects it in the main central pane and displays component's details in the properties pane on the right. For longer questionnaires, you can collapse groups for additional overview. You can also use Multiselect components here.

Components pane

The Components pane shows a list of available components or building blocks that you can add to your questionnaire.

The main component of a questionnaire is a group. It its a collection of questions. Typically, it is used to categorize questions by relevance.

Static components

Static components are designed to show static text, images, links or entity links. These components cannot be changed by user filling the questionnaire template.

Component Description
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.
Static 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

Input components are components used to set up questions of many kinds.

Component Description
Text Adds a question type of a single line of text
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 Choices 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.
Checkbox 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.
Tagged Image Adds a question that requires a picture as an input. Additionally, you can mark portions of the image with tags.
Image Recognition Adds a question that requires a picture as an input. Uses AI Image Recognition for further processing.
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

Some question types might be unavailable if your inspectors are using smartwatch or voice to perform the inspection; see supported question types.

Regarding lookup component

Component Description
Regarding Lookup Regarding lookup is a special component. When you open the questionnaire from an entity record, this field is automatically filled with the record. In this case you might just want to display it on screen. Alternatively, when you start the questionnaire from the home screen, this field will not be filled automatically; the user of the mobile app can select an entity record there.

Snippets pane

The Snippets pane shows a list of available snippets that you can add to your questionnaire.

Properties pane

When you select a component in a questionnaire or snippet, properties of the component are displayed on the right side of the window.

Basic properties
  • Id – Each component has its own unique ID. User can’t change it.
  • Name – User can edit the displayed name for any component. It can be changed at any point, however, if the displayed names are used in any rules, you must change the rules as well.
Properties on Questionnaire level
  • Version Name – Internal name of the versioned questionnaire. You set it when you enable versioning for a template; it cannot be changed afterwards.
  • Version – Number of the version. Assigned by system, cannot be changed.
  • Status – Questionnaires start in Draft status. Status cannot be changed on the Properties pane, use toolbar buttons instead. Available values depend on whether the questionnaire template is versioned or not:
    • Non-versioned: Active, Draft, Inactive
    • Versioned: Draft, Published, Staged, Archived
  • Answer Storage – Select how should the answers be stored:
    • Records: This is the default option. Each answer is transferred as a single record during synchronization. This may make synchronization slower, but ensures the best compatibility with the back-end servers and allows you to leverage existing tools to visualize the data.
    • JSON or Compressed JSON: These options offer improved synchronization performance, however, not all tools understand JSON.
  • Reuse Answers – Select whether answers from previously completed questionnaires should be prefilled on new questionnaires:
    • Never: Do not reuse.
    • First Match: Take answers from the first completed questionnaire that the system can find.
    • Ask User: User can decide whether to prefill answers or not.
    • Select by User: User can select from a list of previously completed questionnaires.
  • Reuse Fetch – Click to display the Filter editor where you define or modify the list of questionnaires available for reuse.
  • Last Modified On – Date and time of the last time the template was modified.
  • Last Modified By – User name of the user who saved this template for the last time.
  • Script Path – Path to the offline JavaScript file that offers enhanced logic to the questionnaire.
Properties on Question level
  • Style – User can choose from the offered component styles
  • Required – when enabled, component is mandatory.
  • Show on report – when enabled, component is visible on the report.
  • Visible – when enabled, component is visible.
  • Filter – for lookup questions, you can set up filter the available records or change the sort order.
  • Reuse – prefill answer for this question
  • Format – some components offers the additional option to select desired format.
  • Storage – for image-type questions, select the entity where the image is stored
Actions for image-type questions
  • Action Mask – numeric representation of the actions selected below
  • Signature – allow user to answer the image question by drawing a signature
  • Capture Photo – allow user to answer the image question by capturing a photo
  • Select Photo – allow user to answer the image question by selecting from your existing photos
  • Select File – allow user to answer the image question by selecting from files
  • Record Audio – allow user to answer the image question by recording an audio message
  • Record Video – allow user to answer the image question by recording an video message
  • Import
  • Edit Image – allow user to edit the image
Properties on Group level
  • Visible – When enabled, component is visible.
  • Expanded
  • Repeatable – Repeatable groups may appear in your questionnaire multiple times.
  • Min Repeat Count, Max Repeat Count – Specify how many instances of a question group are allowed.
  • Copy Values – Prefill answers to the questions in a repeated group based on the previous answers. This is useful when most of the entered values don't change.

Managing components

  • To add components to a questionnaire or snippet, go to the Components pane and click the plus sign (+). The chosen component is added into or under the currently selected component.
  • To select a component, click it - either in the Questions pane or in the central pane.
  • To move component to a different location, click the button in the top left corner of each component and drag it to the right spot. Alternatively, use the Move Up and Move Down toolbar buttons.
  • To toggle visibility of a component, use the eye icon or change the Visible property on the properties pane.
  • To mark a question as mandatory, click the exclamation point (!), or change the Required property on the properties pane.
  • To create a duplicate of a components, click Clone.
  • To delete a component, click the x button in the top right corner of a component.

Groups

Questions are usually organized into groups. One of the advantages of groups is that they can be set 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

Use the group property Copy values if you want that the answers to the questions in a repeated group are pre-filled based on the previous answers. This is useful when most of the entered values don't change.

Individual questions have numerical indexes, question groups have alphabetical indexes and they 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. For example, 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.

Tagged image

The tagged image question allows the user to capture or select an image, and then drag tags onto the image. In the questionnaire template, each tag is actually a question group. Users can add information to each tag. If the question groups are repeatable, the tag can be dragged to the image multiple times.

  1. Edit a questionnaire template.
  2. Go to the Components pane and add a Tagged Image to the template.
  3. Add one or more question groups to the template. For example, create repeatable groups called Person and Thing.
  4. Add some questions to each group. For example, into the Person group, add a Text question called Name and a Whole Number question called Age.
  5. Select the Tagged Image question created in step 2. On the Properties pane, check what Actions should be available: Capture Photo or Select Photo. By default both are enabled.
  6. In the Allowed Groups selector under Tagged Image, select the question groups that you want to be available as tags, then click + button to add them.
  7. For each added group/tag, you can then:
    • Select the background color of your tag
    • Upload an icon that appears in the center of your tag.
    • Mark the tag as mandatory.

Editing rules

Rules describe sequences of steps that are executed when the user is filling out the questionnaire. These steps allow you 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 the Rules editor by clicking on the corresponding event button.

  • On Load rules are executed when users start to fill out the questionnaire.
  • On Change rules are executed whenever users change any value. On Change rules also executed when you a questionnaire is displayed.
  • On Save rules are executed when users complete a questionnaire (just before).
  • On Repeat rules are executed when a new instance of a repeatable group is displayed.
  • On Delete rules are executed when an existing instance of a repeatable group is deleted.

In the rules editor, add rules and conditions using the toolbar to create your rule script.

Steps group
  • 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.
  • 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.
  • Scan Image – Allows you to initiate barcode scanning or image recognition, resulting barcode or recognized image is saved to a string.
  • Variable – 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.
  • Shared variable – add a variable which covers the entire questionnaire form
Conditions group
  • 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.
  • 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.
  • Condition – adds another condition to the same if
  • Group And / Group Or – select two or more conditions and choose whether all need to be met or only one of them
  • Ungroup – Selected condition consisting of several conditions is divided into separate conditions

Example: Automatically fill fields (On Load rule)

You might want that some fields are automatically filled in when a user starts the questionnaire.

  1. Open On Load rule editor on a questionnaire.
  2. Set up a rule with the following logic:
    1. Add the condition If the questionnaire is new.
    2. Add Step: For the question Date and Time set the value to now.
    3. Add Step: For the question Filled by set the value to the current user.
  3. Save the rule, questionnaire, and test it in the application.

Rules example.png

Example: Show additional question depending on previous answer (On Change rule)

When a user answers a question in a certain way, you might want to display additional questions. For example, married users need to provide the name of their partner.

  1. Create a group with two questions:
    • A single choice question: Are you married? (Answers: Yes, No.)
    • A text question: Partner name. Invisible by default
  2. Select the first question and click On Change.
  3. Set up a rule with the following logic:
    1. Add the condition If: If the answer to the are-you-married question is Yes.
    2. Add Step: Then set visibility for the question partner-name to True.
    3. Add Else.
    4. Add Step: Else set visibility for the question partner-name to False.
  4. Save the rule, questionnaire, and test it in the application.

Rules example 2.png

Editing styles

You can use hand-crafted styles to customize the design of your questionnaire. Styles apply to question blocks (combination of question and answer).

  • To assign styles, select a question and then choose the style on the Properties pane. You can also change this assignment via rules.
  • To modify or add new styles, click Styles to open the styles editor.

The designer comes with multiple predefined styles. You can use the toolbar buttons Add or Clone to create new styles. Click Delete to remove styles.

See Style editor for more information.

Configuring commands

You can configure commands available in the app when answering a questionnaire. This works similarly to Form commands in Woodford.

  1. Edit a questionnaire template.
  2. Click Edit to open the command configuration window.
  3. Move commands from the Available Commands pane to the Selected Commands pane.
  4. If a command has multiple options (like Run report), select it and click Properties to configure the available options.
  5. Click Save & Close.

Available commands

  • Complete and close
  • Complete with a report
  • Run report
  • Cancel the questionnaire
  • Clear answers

You can also create custom commands. Use the rules On Execute and On Can Execute to make the command to actually do anything.

Technical information

All questionnaire data is saved as records on your CRM server, in three custom entities:

  • Resco Questionnaire
  • Resco Question Group
  • Resco Question

When an app user starts a questionnaire in the app, a new copy of the template is created. For an answered questionnaire, we store both questions and answers. This approach ensures that when you change your questionnaire template, existing answered questionnaires are not affected; historical records are not altered.

Data model

Questionnaire data can be saved in three different ways:

  • Record-based model (default): Each answer in a questionnaire is a record.
  • JSON / compressed JSON: Answer are stored in JSON format that might be compressed. JSON requires less records and may result in faster synchronization. However, analyzing the answers may require additional effort.
  • Hybrid model (planned for a future release): Combination of the previous two models. For each question, you can configure what you prefer.

The data model can be configured on the Properties pane, in the Answer Storage field.

Completion status

A questionnaire has a status field that can take three values:

  • [0] Active (incomplete, in progress)
  • [1] Completed
  • [2] Canceled