{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":15929,"path":"financial-services-operations/fso-int_guide-agt_table_update.md","title":"Update remote information in the system of record","bundle":null,"doc_type":null,"release":"australia","body":"\n# Update remote information in the system of record\n\nThis integration scenario illustrates how to update a system of record within the bank application.\n\nIn this scenario, a script in a ServiceNow workflow makes a request to the remote bank application to update a customer's credit card limit. If the new limit is approved, the customer limit is updated in the bank application \\(system of record\\).\n\n**Note:** There are cases where the same information, such as a customer's credit card limit, is in both the system of record on a remote system and in the ServiceNow database. Whenever querying this type of information, ensure that you always use the information in the system of record, as the information in the ServiceNow database may not be current. Use your discretion as to whether you update this information in both data stores. This use case does not update the information in the Credit Card Account \\[sn\\_bom\\_cred\\_card\\] table.\n\n**Note:** This scenario assumes the bank application exposes the REST endpoint POST /api/card/updateLimit that handles the update request from the ServiceNow workflow.\n\n\\[Omitted image \"fso-update\\_external\\_record-flow.png\"\\] Alt text: FSO case flow that shows how to update a system of record within the bank application\n\nThe table that is accessed in this scenario is the [Consumer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/financial-services-operations/fso-int_guide-table_defs.md) \\[csm\\_consumer\\] table which contains the business-to-customer records.\n\nThe following diagram shows the flow of the REST API calls for this use case and provides brief remarks on any required processing. It assumes that you have used the steps outlined in [Lookup remote information in the system of record](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/financial-services-operations/fso-int_guide-agt_table_lookup.md) to obtain the customer account information.\n\n<table id=\"table_rmq_ywq_bpb\"><tbody><tr><td>\n\n\\[Omitted image \"fso-update\\_ext\\_record-swim\\_diagram.png\"\\] Alt text: Workflow that shows the REST API calls that are used to obtain the customer account information.\n\n</td><td>\n\n1.  Script in the workflow requests the associated consumer record and uses that information to obtain the information needed to request the associated Credit Card Account record.\n2.  Script in the workflow calls the POST /api/card/updateLimit endpoint on the bank application to request that the associated customer's credit limit be increased.\n3.  Bank application returns the status of the request.\n4.  Status update\n\n</td></tr></tbody>\n</table>## Example code\n\nThe follow is a JavaScript example that performs the steps outlined above:\n\n```\n// Shows how to  request the increase the credit limit for a specified card\n// This code assumes there is a REST endpoint 'api/card/updateLimit' on the bank application system\n\n// REST call to the /api/card/updateLimit endpoint to request \n// an update to the customer's credit card limit\nfunction updateCreditLimit(requestBody) {\n\n  var request = new sn_ws.RESTMessageV2();\n  request.setHttpMethod('post');\n  request.setEndpoint('/api/card/updateLimit');\n  request.setRequestBody(JSON.stringify(requestBody));\n  var response = request.execute();\n\n  var responseBody = response.getBody();\n  var responseObj = JSON.parse(responseBody);\n\n  return responseObj;\n}\n\n// The following is the data object sent to the /api/card/updateLimit endpoint\n// to increase the credit limit for the card\nvar requestBody = {\n  'cardNumber': 'xxxx-xxxx-xxxx-5896',\n  'accountNumber': 'xxxxxxxxxxxx9590',\n  'oldLimit': 'USD 5000',\n  'newLimit': 'USD 10000',\n  'requestType': 'Increase_limit',\n};\n\nupdateCreditLimit (requestBody);\n```\n\n"}}