Surveys and assessments

Surveys and on-demand assessments created in the ServiceNow database can be included in Mobile Reach Apps.

See ServiceNow Surveys and ServiceNow Assessments for information on creating surveys and assessments in ServiceNow.

Configuring Surveys/Assessments

Use the following steps to configure your App to use surveys and/or assesments.

  1. Load processors: The MRSurveyGet and MRSurveyAdd ServiceNow processors allow Apps to access survey and assessment definitions on the ServiceNow database and create survey responses. These processors are included in the dispatchservicenow plugin, but must be loaded to the ServiceNow database server before they can be used.

    NOTE: Even if you loaded these processors prior to release 1652.1485, you need to delete and re-load them. These processors have been updated to support assessments.

    Run the Setup Server command on the AppStudio Tools menu to load all ServiceNow processors used in Apps to the ServiceNow database server.

  2. Create a virtual table: Surveys and assessments created in ServiceNow can be used as virtual tables in your App. To display the names of all surveys and assessments in AppStudio Form lists, add loadassessments="1" to the SERVER element in the ServiceNow.xml file.

    To display an individual survey or assessment, add a SURVEY element to the ServiceNow.xml file with a name attribute set to the name of the survey or assessment you want to include.

Using surveys and assessments

The virtual table(s) you defined in ServiceNow.xml will be included in the list of tables for the associated server and provide access to all fields defined for the survey or assessment. You can use this table as you would any table in an App.

NOTE: The virtual table is insert-only. Updates will generate an error and attempts to get records will never return results.

RecordId field

When you create an assessment in ServiceNow, you must associate the assessment with a database table. The Gateway server adds a RecordId field to the virtual table you created for the assessment in ServiceNow.xml. This RecordId field is the sys_id of the database table, is available in drop-down lists for the virtual table, and must be included in any App that contains an assessment.

Examples

Example 1: SERVER element configured to display all surveys and assessments in the AppStudio form list:

<SERVER name="testinstance.service-now.com" loadassements="1">

Example 2: ServiceNow.xml file configured to display an individual survey or assessment as a form in AppStudio:

<SERVER name="testinstance.service-now.com" loadassements="1">
<SURVEY name="Test Survey 1"/>
</SERVER>

Example 3: An application that includes two surveys.

survey_example

Example 4: An application configured for an assessment. A combobox is used to set the recordid for the assessment.

assessment