{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1151,"path":"api-reference/server-api-reference/v_tableAPI.md","title":"v\\_table – Scoped, Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# v\\_table – Scoped, Global\n\nThe v\\_table API provides methods to add rows to a remote table through a scriptable object.\n\nThis API requires the Remote Tables plugin \\(com.glide.script.vtable\\) to be activated. For additional information, see [Retrieving external data using remote tables and scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/remote-tables.md).\n\nUse the [v\\_query](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/v_queryAPI.md) scriptable object to query remote tables.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## v\\_table - addRow\\(Object row\\)\n\nAdds rows to the remote table.\n\nSee also:\n\n-   [Create a script definition for a remote table](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/create-remote-table-script.md)\n-   [Lookup remote information in the system of record](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/financial-services-operations/fso-int_guide-agt_table_lookup.md)\n-   [Retrieving specific records from a third-party source](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/remote-table-script-def-example2.md)\n-   [v\\_query API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/v_queryAPI.md)\n\n<table id=\"table_udd_bdj_nlb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nrow\n\n</td><td>\n\nObject\n\n</td><td>\n\nJavaScript object containing field name and value map in which the key is the field name, for example, `{number: \"INC0001\", sys_id: \"a34\"}`.```\n{ \"<field name>\": \"value\" }\n\n```\n\n</td></tr><tr><td>\n\nrow.&lt;field value&gt;\n\n</td><td>\n\nString\n\n</td><td>\n\nRepresents the value of the selected field. Although no fields are mandatory, provide the sys\\_id at a minimum.Example listing only sys\\_id field and value:\n\n ```\n{ \"sys_id\": \"<uniqueID>\" }\n\n```\n\n</td></tr></tbody>\n</table><table id=\"table_vdd_bdj_nlb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether the row was added to the remote table.Valid values:\n\n-   true: Success.\n-   false: Row was not added.\n\n</td></tr></tbody>\n</table>The following example shows how to use the [RESTMessageV2](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_RESTMessageV2API.md) API to create and execute the REST call to an external bank application. The script shows how to use the addRow\\(\\) method to store return results in a remote table.\n\n```\n(function executeQuery (v_table, v_query) {\n  // Parameters needed in the request body of the REST endpoint\n  var requestBody = {\n    'financial_account':v_query.getParameter('financial_account')\n  };\n\n  // Instantiate the RESTMessageV2 object\n  var request = new sn_ws.RESTMessageV2();\n  // Set the HTTP method as \"GET\"\n  request.setHttpMethod('get');\n  // URL of the endpoint on the bank application\n  request.setEndpoint('https://<yourbankapphost>/api/getTransactionDetails');\n  // Request body as a string\n  request.setRequestBody(JSON.stringify(requestBody));\n  // Call the REST endpoint\n  var response = request.execute();\n  // Get the response body\n  var responseBody = response.getBody();\n  // Parse the response body into an object\n  var responseObj = JSON.parse(responseBody);\n\n  // Store the response body into a virtual table\n  v_table.addRow({\n    sys_id: gs.generateGUID(),\n    amount: responseObj.amount,\n    description: responseObj.description,\n    posting_date: responseObj.posting_date,\n    transaction_date: responseObj.transaction_date\n  });\n\n}) (v_table, v_query);\n```\n\n"}}