Lookup remote information in the system of record
Summarize
Summary of Lookup Remote Information in the System of Record
This document outlines the process for using a REST API call to retrieve financial transaction details from a remote banking system for customer mortgage accounts within ServiceNow. A call center agent initiates this by creating a Financial Services Operations (FSO) case in ServiceNow, where they input relevant customer and account information.
Show less
Key Features
- REST API integration to fetch financial transaction details from a remote banking application.
- Data is temporarily cached in remote tables within ServiceNow, ensuring performance without cluttering the ServiceNow database.
- Option to store fetched data in ServiceNow database tables using the GlideRecord API.
- Implementation of the vtable API for managing remote data.
Key Outcomes
By following this use case, ServiceNow customers can:
- Quickly verify customer financial transaction details during case creation, improving response times.
- Utilize efficient API calls to streamline data retrieval from external systems.
- Enhance the user experience in the FSO form by displaying relevant financial data seamlessly.
Implementing this setup requires activating the Remote Tables plugin and following the provided code examples for executing REST calls and displaying results in the FSO form.
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();