Pending questionnaires
Warning | Work in progress! We are in the process of updating the information on this page. Subject to change. |
The feature pending questionnaires allows you to prepare empty questionnaires and assign them to a record, such as a work order. When working on a work order, mobile users simply fill out the prepared questionnaire(s).
Templates versus pending questionnaires
The traditional way of starting new questionnaires in the mobile app is:
- Open the form of a record, for example, a work order.
- Go to the list of questionnaire templates.
- Find the right template and run it.
The list of questionnaire templates can be long and the user has to know which questionnaire to start. Some customers prefer a different approach. When a new work order is created (or service task or any other similar record), a brand new instance of the relevant questionnaire(s) is created and attached to the record. Users can then simply open the record and immediately access the pre-generated questionnaire, saving time and reducing user error.
Prerequisites
- Woodford 18.0 or later.
- Resco Mobile CRM 18.0 or later is needed to display such questionnaires correctly.
- Not supported on the web app.
- Currently only supported when using "resco_questionnaire" as the answer storage table.
How to set up pending questionnaires
Here's a high-level overview of steps required to set up this scenario.
- Contact Resco support, send them your Organization ID, and ask them to enable the feature "Precreate empty answer records for template". (This step is necessary while the feature is in a preview phase.)
- Set up the appropriate business logic that prepares the questionnaires. For example, using Power Automate or rules editor, when a new instance of a work order is created, create also the appropriate questionnaires and set them up correctly.
- In your work order form, add the list of pending questionnaires.
Technical details
When generating the resco_questionnaire in your business logic, make sure to set up the following parameters:
- resco_templateid = ID of the questionnaire template
- is_template = false
- resco_completionstatus = -1 (new status introduced for this feature)
Optionally, check out the Resco Inspections data model for more information about the tables used for Resco Inspections.
Notes
- The questionnaire's On Load logic will run the first time the questionnaire is opened in the app. You should not depend on the data stored in the pending questionnaire before that as it is really only an empty instance with reference to the template.
- You can prefill values for the questionnaire by using custom columns created on the questionnaire table. The values in these columns will stay in the columns even after the questionnaire is initialized the first time in the app.
- Do not store any data in the standard "resco_" field of the pending questionnaire: these fields are overwritten the first time the questionnaire is opened and initialized in the app.
- You should know what version of the template you are assigning to the pending questionnaire. The template must be available in the app for the pending questionnaire to be initialized successfully.
- You can use the single line of text fields 'resco_regardingid', 'resco_regardingname', and 'resco_regardinglabel' to create the quasi-lookup reference typically used by questionnaire without direct database lookup to the related table. You need to fill the ID of the regarding records into the 'resco_regardingid' field and the logical name of the regarding entity into 'resco_regardingname'. Optionally, you can populate the 'resco_regardinglabel' with the Primary Name of the regarding record. This way, the pending questionnaire will be displayed under the Inspections section on the regarding record's form.
Example
In the example below, we use a custom table Real Estates.
- We add a button that generates a pending questionnaire to the Real Estates form.
- We create a new view for pending questionnaires.
- We add the list of pending questionnaires to the Real Estates form.
Creating a pending questionnaire via button click rule
- Edit the form of the Real Estates table in Woodford.
- Add a button to the form.
- Define a Button Click rule that creates a new questionnaire record, assigns some values, and saves the record.
- In the green section, we create a new instance of the questionnaire and assign some necessary parameters.
- In the blue section, construct a quasi-link from the questionnaire record to the parent Real Estate record.
- In the red section, select the questionnaire template, enter the new record's name, and save it.
Tip | A more real-life scenario might be to trigger the generation of a questionnaire when a new parent record is generated. An example of such an On Save rule is available here. Pay attention to the first and the last lines of the rule: Trigger only when the record is new, and save the second record after the first to ensure that links function correctly. |
Creating a questionnaire view
- Go to the questionnaire entity in Woodford.
- Create a new associated view.
- Filter the relevant records, i.e., resco_completionstatus = -1.
Putting it all together
- Go back to the Real Estate form.
- From the Tabs pane, add the Inspections list to the form.
- In the list properties, select the new associated view.
- Save all changes and publish the app project.
You can now test the results in Resco Mobile CRM. Tapping the Make questionnaire button should create a new instance of a questionnaire waiting to be answered.
Tip: change list
In the process of setting up this feature, consider adding the Change List to your test app. This way, you can quickly check the generated pending questionnaire to see if all parameters are populated correctly.
Variants
In this example, we used Resco Mobile CRM rules as the business logic for generating the new pending questionnaire record. However, you can use other methods, such as Power Automate.
- First, we trigger the flow when a new row is added.
- Next, we fetch the template. In the example, we fetch it by Row ID. In a production scenario, consider fetching the latest published version of a template with a particular name.
- In the last step, we create the new pending questionnaire (add a new row to the Questionnaires table). If you add some extra fields to the Questionnaires table (such as the Account lookup in the sample below), you can populate them here and use them later.