ServiceNow Repeatable Destination: Create Multiple Test Records Linked to an Asset

This recipe shows you how to deploy a solution for mobile users who need to quickly document repetitive service tasks using TrueContext.The captured information then creates multiple Test records associated with an Asset record in ServiceNow.

This recipe shows you how to:

Available on the Advanced and Enterprise tiers:

Essentials
Advanced
Enterprise

Contents

Recipe overview

Scenario

A field service technician performs system tests as part of preventive maintenance on Medical Devices. The service organization keeps a record of the tests and their results in a ServiceNow table. This enables asset management dashboards and automation to trigger workflows such as break-fix and other asset life cycle tasks.

Objectives

Result

  1. The field service technician performs preventive maintenance on a medical device. When they start the work, they select the Asset they’ll work on from a predefined list of options.

    Form open in the ProntoForms Mobile app. A user chooses an option from a list of Medical Device assets predefined in a Dropdown question. The user selects "MRI000005 - Philips Ingenia 1.5T".

  2. The technician adds an entry in a repeatable section for each test performed on the Asset.

    ProntoForms Mobile app with form open. The form shows a repeatable section with an entry for each test performed on the Asset.

  3. When the technician submits the form, a Data DestinationClosed A Data Destination specifies where to send data from a submitted form. You can use Data Destinations to automate data sharing and storage, routing data to a specific service (such as email or cloud storage) in several different formats. updates the Asset record to include details about the latest inspection. The following image shows the ServiceNow field populated with the data from TrueContext.

    ServiceNow Asset record that shows the "Last Checklist Activity" field. This field was automatically populated with submitted form data and metadata including the form name, date and time of submission, and user that submitted the form.

  4. A Repeatable Destination creates a record for each of the tests performed. These records have a Reference field that links them to the serviced Asset. The following image shows the Test records in ServiceNow.

    ServiceNow Asset record that shows child Test records. Each record was created by ProntoForms for each Test entry in the Repeatable Section.

Prerequisites

ServiceNow prerequisites

You must have a ServiceNow admin role or another role that allows you to create tables.

TrueContext prerequisites

Steps to complete this recipe

Overview of steps

System Action
ServiceNow Create a Tests and Calibrations table that has a reference field.
TrueContext Set up a Data Source to fetch Asset data from ServiceNow.
Set up your form to capture the Asset sys_id.
Create a Repeatable Section to capture the tests.
Set up a Data Destination to update the Asset record.
Set up a Repeatable Destination to create test records linked to the Asset record.
Add the Data Destinations to the form.

Detailed steps

Create a Tests and Calibrations table in ServiceNow

The Tests and Calibrations table stores the data from the tests that the field technician performs on an asset.

  1. Create a table as described in the ServiceNow Documentation. For this recipe, enter the following:

    • LabelTests and Calibrations

    • Nameu_test_and_calibration

  2. Add a Reference field. Enter the table name alm_hardware.

    Tip:Your Assets could be stored in a different table than alm_hardware. Enter the name of the table that’s best for your workflow.

  3. Add any other columns you need to store the data collected in each test. The following example shows some columns added to the Test and Calibrations table:

    ServiceNow Tests and Calibrations table definition. The image shows each column's Column Label, Type, and Reference.

Set up a TrueContext Data Source to fetch Asset data from ServiceNow

  1. Create a ServiceNow Table Data SourceClosed Data sources, also known as "Lookups", are external sources of data that you upload or connect to TrueContext. You can reference this data in a form to populate answers or answer options. Data sources save typing, reduce errors, and make it easy to provide mobile users with only the relevant, most current data.:

    Forms & Integrations > Data Sources > CREATE DATA SOURCE > ServiceNow Table

  2. Enter the name Medical Devices.

  3. Go to the Connection tab. For this recipe set up the Data Source as follows:

    Field Value
    Name of the Table alm_hardware

    Tip:Your Assets could be stored in a different table than alm_hardware. Enter the name of the table that’s best for your workflow.

    Column Selection
    • sys_id

    • display_name

    Record Filtering

    asset_tagLIKEH2456^NQasset_tagLIKEMRI^NQasset_tagLIKEXR

    Tip:This string filters assets that have the tags H24556, MRI, and XR. Use a query string that works for your records.

  4. Select Create to save your Data Source.

Set up your form to capture the Asset sys_id

  1. Create a new form or edit an existing form:

    Go to Forms & Integrations > List Forms > Create Form or

    Forms & Integrations > List Forms > FormName > Edit Form or Continue Editing.

  2. Create a Dropdown question for the list of Asset names. When a field technician selects an Asset, this question populates the Asset ID question.

    ADD A QUESTION > Dropdown

    Set up the GENERAL details:

    Field Value
    Question Text Asset
    Unique Identifier for Question Asset
  3. Go to the OPTIONS tab and set up the question as follows:

    Field Value
    Option Type Select Use Data Source for Options.
    Select Data Source Select Medical Devices. This is the Data Source you created.
    Column value displayed on device Select display_name. These are the Asset names from the ServiceNow Data Source.
  4. In the Push Data To Other Questions section, select Populate questions in the main form. Set the following:

    Field Value
    Question to populate

    Enter Asset ID and press the Enter key.

    Answer source

    Select sys_id.

    Result: When the technician selects an Asset from the Dropdown, the Asset ID question is automatically populated.

Create a Repeatable Section to capture the tests

  1. Add a Repeatable Section to your form:

    ADD A SECTION > Repeatable

  2. Enter the following General Information:

    Field Value
    Section Name Tests
    Unique Identifier for the Section

    Tests

    Tip:Take note of this Unique Identifier. You’ll need it when you create the Repeatable Destination.

  3. SAVE the new Repeatable Section.

  4. Select EDIT SUMMARY TABLE OR QUESTIONS.

  5. Add test questions to the Repeatable Section. The following image shows an example of test questions to add to the section.

    Questions in a Repeatable Section. The questions are Test Name, Sample, Measurement 1, Measurement 2, Average, and Test Result.

  6. Select SAVE AS DRAFT.

Set up a Data Destination to update the Asset record

  1. Create a ServiceNow Table Data Destination:

    Forms & Integrations > Data Destinations > CREATE DATA DESTINATION > ServiceNow Table

  2. Enter the Destination Basics. Name this destination Update Medical Asset.

  3. In the Destination Type section, select the option to make this a Regular Destination.

  4. On the ServiceNow Table Fields tab:

    1. Enter alm_hardware as the Name of the Table, or enter the name of the table where you store your Assets.

    2. Map the ServiceNow fields you want to update as shown in the following example:

      ServiceNow Field Mapping example. A checklist field in ServiceNow is populated with submitted form data and metadata, including the form name, date and time when the form was submitted, and the user who submitted the form.

      Field Value
      ServiceNow Column Name Enter the names of the ServiceNow columns to update. In the example, the Data Destination updates a field called Last Checklist Activity.
      Value Expression Enter a DREL expression to reference submitted form data or metadata. The example shows an expression that references the form name, the date and time when the form was submitted, and the field technician’s name.
  5. Set up an Update Query that finds and updates the Asset that has a matching sys_id. The sys_id is a unique identifier for each Asset record.

    In this example, The Data Destination references the question that you populated with the Asset sys_id when you set up the Data Source. This ensures that the system updates the correct Asset that the technician inspected.

    Update Query page. The Update Handling is set to "Update if exists, do not create new", the ServiceNow Column name is sys_id, and the Value Expression is %a[AssetId].

  6. Select Create to save your Data Destination.

Set up a Repeatable Destination to create the test records linked to the Asset record

  1. Create a ServiceNow Table Data Destination:

    Forms & Integrations > Data Destinations > CREATE DATA DESTINATION > ServiceNow Table

  2. Enter the Destination Basics. Name this destination Medical Asset Tests.

  3. In the Destination Type section, select the option to make this a Repeatable Destination. Enter the Unique Identifier of the Repeatable Section you created. In this recipe, the Unique Identifier is Tests.

  4. Go to the ServiceNow Table Fields tab. Enter u_test_and_calibration as the Name of the Table.

  5. Map the Asset Reference field to the Unique IDClosed A Unique ID refers to the specific identifier of a question, form page, form section, or Data Destination. Unique IDs are used as reference points when pulling data for conditional logic, Analytics projects, Data Destinations, and Documents. of the Asset ID question:

    ServiceNow Data Destination column mapping that shows how to map to a reference field. Under ServiceNow Column Name, the user entered u_asset. Under Value expression, the user entered %a[AssetId]

    Result: When the destination executes, it populates the Reference field with the Asset sys_id. This is how each record is linked to the serviced Asset.

  6. Map the other columns in the ServiceNow Tests and Calibrations table to the Unique IDs of the questions in the Repeatable Section.

    ServiceNow Column mapping. The questions in the Repeatable Section map to the columns in the ServiceNow Tests and Calibrations table.

  7. Go to the Update Query tab. Set the Update Handling to Never update, always create new.

    Result: The Data Destination creates a new record for each entry in the Repeatable Section.

  8. Select Create to save your Data Destination.

Add the Data Destinations to the form

  1. Go to Forms & Integrations > List Forms > FormName > Edit Form or Continue Editing.

  2. On the Destinations tab, select Add a Data Destination.

  3. Add the ServiceNow Table Data Destinations you created: Update Medical Asset and Medical Asset Tests.

  4. Save and Deploy the form.

    Result: When the field technician submits the form, the system executes both Data Destinations and sends data to ServiceNow.

Related topics