Lookup remote information in the system of record
Summarize
Summary of Lookup remote information in the system of record
This use case demonstrates how ServiceNow can integrate with a remote banking system (system of record) to retrieve financial transaction details for a customer's mortgage account using a REST API call. A call center agent initiates this process by entering customer and account information into a ServiceNow form (FSO case). The system then queries the remote bank via a REST endpoint to fetch transaction details, which are displayed on the form for agent verification before completing the case. The retrieved data is cached within ServiceNow using remote tables.
Show less
Key Features
- REST API Integration: Uses the RESTMessageV2 API to call the remote banking system’s GET /api/getTransactions endpoint, sending customer financial account info and receiving transaction details.
- Remote Tables: Stores fetched transaction data in-memory on ServiceNow using the vtable API, avoiding permanent storage in ServiceNow database tables. This requires activation of the Remote Tables plugin (com.glide.script.vtable).
- Data Display: Transaction details such as amount, description, posting date, and transaction date are shown on the ServiceNow FSO form for agent review before manual case completion.
- Alternative Data Storage: The scenario can also be implemented by writing remote data directly to ServiceNow database tables using the GlideRecord API, depending on customer needs.
Practical Use and Implementation
ServiceNow customers can leverage this approach for real-time retrieval of authoritative financial data from external banking systems, enhancing data accuracy and agent efficiency during customer interactions. The provided example scripts illustrate how to:
- Construct and execute REST calls to the external API with relevant parameters.
- Parse and cache the returned transaction data in remote tables.
- Query the cached remote data within ServiceNow and populate it dynamically on forms.
This integration enables agents to validate external financial information without leaving ServiceNow, streamlining case creation and improving customer service quality.
This use case illustrates how to use a REST API call to lookup financial transaction details for a customer’s mortgage account on a remote banking system (system of record).
A call center agent responds to a customer inquiry and creates a new FSO case using a ServiceNow form. In that form, they manually enter the consumer, financial account, category, and short description information, and any associated notes.
Using the consumer and financial account information, a script within the ServiceNow form calls a remote REST endpoint on the remote banking system (bank application) to obtain the financial transaction details. It then displays these details in the ServiceNow form so that the agent can verify the information before manually entering the remainder of the required case information. Once complete, the FSO case is cached on the ServiceNow instance.
The following is an example of what the financial transaction details received from the remote bank application might look like when they appear on the FSO case form:
The following diagram shows the application flow for this use case scenario and provides brief remarks on any required processing. In this implementation, the data obtained from the remote bank application is store in remote tables. Remote tables are only cached in memory, they are never stored in the ServiceNow database tables. You can also implement this scenario by writing the remote data to the corresponding ServiceNow database tables. The s scenario illustrates how to store data in the ServiceNow database tables using the GlideRecord API.
|
Example code
(function executeQuery (v_table, v_query) {
// Parameters needed in the request body of the REST endpoint
var requestBody = {
'financial_account':v_query.getParameter('financial_account')
};
// Instantiate the RESTMessageV2 object
var request = new sn_ws.RESTMessageV2();
// Set the HTTP method as "GET"
request.setHttpMethod('get');
// URL of the endpoint on the bank application
request.setEndpoint('https://<yourbankapphost>/api/getTransactionDetails');
// Request body as a string
request.setRequestBody(JSON.stringify(requestBody));
// Call the REST endpoint
var response = request.execute();
// Get the response body
var responseBody = response.getBody();
// Parse the response body into an object
var responseObj = JSON.parse(responseBody);
// Store the response body into a virtual table
v_table.addRow({
sys_id: gs.generateGUID(),
amount: responseObj.amount,
description: responseObj.description,
posting_date: responseObj.posting_date,
transaction_date: responseObj.transaction_date
});
}) (v_table, v_query);Example code
function getRequiredInfo() {
// Instantiate a GlideRecord object with the remote table containing the financial transaction details.
var now_GR = new GlideRecord('transaction_details_remote_table');
// Create a query to obtain the desired financial account
now_GR.addQuery('financial_account', g_form.getValue('financial_account'));
// Execute the query
var result = now_GR.query();
// Display the data in the FSO form
var data = [];
data ['amount'] = result.amount;
data ['description'] = result.description;
data ['posting_date'] = result.posting_date;
data ['transaction_date'] = result.transaction_date;
return data;
}
getRequiredInfo();