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:
-
Add a Repeatable Section
A Repeatable Section is a subform that contains a set of related questions. The data captured is “repeating”, because the field user can complete the same subform more than once, which creates multiple entries. to your form so that technicians can input multiple tests associated with an asset.
-
Set up a Data Source
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., A Regular Destination that updates the Asset, and a Repeatable Destination
A Repeatable Destination is a TrueContext Data Destination that sends data from a Repeatable Section to a field-based, third-party system. that creates the Test records in ServiceNow.
Available on the Advanced and Enterprise tiers:
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
-
Technicians capture multiple tests for an Asset using a Repeatable Section
A Repeatable Section is a subform that contains a set of related questions. The data captured is “repeating”, because the field user can complete the same subform more than once, which creates multiple entries. in the form.
-
The TrueContext connection updates the Asset record to include details of the service using a Regular Data Destination
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..
-
The TrueContext connection creates a child test record for each entry captured in the Repeatable Section using a Repeatable Destination
A Repeatable Destination is a TrueContext Data Destination that sends data from a Repeatable Section to a field-based, third-party system..
Result
-
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.
-
The technician adds an entry in a repeatable section for each test performed on the Asset.
-
When the technician submits the form, a Data Destination
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.
-
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.
Prerequisites
ServiceNow prerequisites
You must have a ServiceNow admin role or another role that allows you to create tables.
TrueContext prerequisites
-
You must be a TrueContext Admin user.
-
Your team must be on the Advanced or Enterprise tier.
-
You must set up a ServiceNow Connection to use ServiceNow Table Data Sources
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. and Data Destinations
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..
Steps to complete this recipe
Overview of steps
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.
-
Create a table as described in the ServiceNow Documentation. For this recipe, enter the following:
-
Label—Tests and Calibrations
-
Name—u_test_and_calibration
-
-
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. -
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:
Set up a TrueContext Data Source to fetch Asset data from ServiceNow
-
Forms & Integrations > Data Sources > CREATE DATA SOURCE > ServiceNow Table
-
Enter the name Medical Devices.
-
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.
-
-
Select Create to save your Data Source.
Set up your form to capture the Asset sys_id
-
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.
-
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 -
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. -
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
-
Add a Repeatable Section to your form:
ADD A SECTION > Repeatable
-
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.
-
SAVE the new Repeatable Section.
-
Select EDIT SUMMARY TABLE OR QUESTIONS.
-
Add test questions to the Repeatable Section. The following image shows an example of test questions to add to the section.
-
Select SAVE AS DRAFT.
Set up a Data Destination to update the Asset record
-
Create a ServiceNow Table Data Destination:
Forms & Integrations > Data Destinations > CREATE DATA DESTINATION > ServiceNow Table
-
Enter the Destination Basics. Name this destination Update Medical Asset.
-
In the Destination Type section, select the option to make this a Regular Destination.
-
On the ServiceNow Table Fields tab:
-
Enter alm_hardware as the Name of the Table, or enter the name of the table where you store your Assets.
-
Map the ServiceNow fields you want to update as shown in the following example:
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.
-
-
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.
-
Select Create to save your Data Destination.
Set up a Repeatable Destination to create the test records linked to the Asset record
-
Create a ServiceNow Table Data Destination:
Forms & Integrations > Data Destinations > CREATE DATA DESTINATION > ServiceNow Table
-
Enter the Destination Basics. Name this destination Medical Asset Tests.
-
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.
-
Go to the ServiceNow Table Fields tab. Enter u_test_and_calibration as the Name of the Table.
-
Map the Asset Reference field to the Unique ID
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:
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.
-
Map the other columns in the ServiceNow Tests and Calibrations table to the Unique IDs of the questions in the Repeatable Section.
-
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.
-
Select Create to save your Data Destination.
Add the Data Destinations to the form
-
Go to Forms & Integrations > List Forms > FormName > Edit Form or Continue Editing.
-
On the Destinations tab, select Add a Data Destination.
-
Add the ServiceNow Table Data Destinations you created: Update Medical Asset and Medical Asset Tests.
-
Save and Deploy the form.
Result: When the field technician submits the form, the system executes both Data Destinations and sends data to ServiceNow.