Mobile reports for Resco Inspections

From Resco's Wiki
Revision as of 09:56, 8 July 2020 by Jzambor (talk | contribs) (Unsorted information)
Jump to: navigation, search
Warning Work in progress! We are in the process in updating the information on this page. Subject to change.

Traditionally, inspections often involved a lot of paperwork - part of it in the field, and then again in the office, producing a report. Resco Inspections is designed to perform the entire inspection process without any paper documents, however, in many scenarios, it is desirable to finish the inspection with a report, a document that can be sent to your manager or end customer. Fortunately, Resco Inspections allows you to generate such reports directly on your device, immediately after concluding an inspection.

Resco Inspections comes with a generic report available automatically for all questionnaires, and it includes a powerful tool for designing custom mobile reports, the Report Designer. However, even if you are already familiar with the mobile reports in Resco, the unique data structure of questionnaires can sometimes complicate things.

Automatic report

The demo data includes the automatic report, a generic default report for any questionnaire. This report can be made available in the app without any additional configuration using Report Designer. Automatic reports are only available for the standalone Resco Inspections product.

Custom report

While editing a questionnaire using the Questionnaire Designer, you can use the Mobile Report button to open the Report Designer. This function will take the questionnaire structure and convert it into a custom report with the same structure. This new report is also linked to the questionnaire.

Alternatively, you can start Report Designer, create a brand new report from scratch, and link it to a questionnaire manually.


Images in questionnaire reports

If you are using the automatic report function available from the Questionnaire Designer that creates a report from the questionnaire, image-type questions and answers will be included, no extra effort is needed. However, if you are creating a custom report for a questionnaire from scratch, you need to perform a few extra steps to access the right images related to your questions.

When a questionnaire is saved, the image present on the questionnaire is saved as a record in the note/annotation entity. This entity has two important fields that contain the relationship between the questionnaire and the question where the image is set:

  • Regarding/objectid - contains the reference to the questionnaire
  • Title/subject - contains the reference to the question on which the image is saved

Title and regarding fields.png

Both of these fields are needed to be used in the filter to get the note on the report.

The note entity is used for images if your backend is Resco Cloud or Dynamics. For Salesforce, use the contentversion entity instead. The fields have a different name but the general principle remains the same.

  1. Select the report body and click Edit Sources.
  2. Add a new variable of the type Fetch Result for the annotation entity.
    New annotation variable.png
  3. Define the appropriate filter.
    Filter for the annotation variable.png

Logo in questionnaire reports

Adding the logo of the questionnaire template to a report is even easier than adding an image related to a question. The logo is linked directly from the questionnaire and its title equals "-resco_logo".

  1. Select the report body and click Edit Sources.
  2. Add a variable of the type Fetch Result for the annotation entity.
  3. Define the appropriate filter.
    Questionnaire logo in report.png

Images from repeatable groups

In the case of images that are placed within repeatable groups, you need to adjust the annotation fetch according to the name, index, and repetition of the respective question group. When the question group is repeated on the questionnaire form, the name (field "resco_questiongroup.resco_name") is composed of the name of the question group defined in the questionnaire designer and the index of repetition, e.g. "my-question-group#001". The same works for each question placed within.

First, you need to create a child repeater for question group and add "resco_name" condition to the filer. Use the "Contains" operator and the name string from Questionnaire Designer. This way you make that each repetition will be fetched and used in the report's repeater. A good practice is also to define the sort order so that you get the question groups in the same order as on the questionnaire.

  1. Create a child repeater.
    Repeatable1.png
  2. Select the repeater and click Edit Sources, then double-click the filter.
  3. Click Add Condition and enter the condition for "resco_name".
    Repeatable2.png
  4. Save all changes.

Next, define the fetch for “resco_question” entity which will get the correct question record. You need this record to fetch the correct annotation record in the following step. The question filter should use “resco_questiongroup” condition for the question group from step 1 and condition based on the question name and index similarly as in the “resco_questiongroup” filter.

  1. Return to the list of variables of the child repeater.
  2. Click Add to add a variable for the entity "resco_question".
    Repeatable3.png

The final step is to place an image cell into the repeater and define the "annotation" entity filter. The "annotation.objected" must equal the id of the questionnaire and the "annotation.subject" must equal the name of the image question from step 2.

  1. Close the variables list and return to the questionnaire design.
  2. Select a cell in the child repeater grid and click Add Image.
  3. On the Properties pane, click Binding > Select and define a filter for the annotation.
    Repeatable4.png