---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# v_table -- Scoped, Global

# v_table -- Scoped, Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The v_table API provides methods to add rows to a remote table through a scriptable object.

This 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://www.servicenow.com/docs/access?context=remote-tables&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US).

Use the [v_query](https://servicenow-prod.fluidtopics.net/lyJrNorP6Xisuyh64BcmNg#v_queryAPI "The v_query API provides methods to obtain information about a scriptable object that represents a query running against a remote table.") scriptable object
to query remote tables.

## v_table - addRow(Object row) {#ariaid-title2}

Adds rows to the remote table.
See also:

* [Create a script definition for a
  remote table](https://www.servicenow.com/docs/access?context=create-remote-table-script&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US)
* [Lookup remote information in the
  system of record](https://www.servicenow.com/docs/access?context=fso-int_guide-agt_table_lookup&version=xanadu&pubname=xanadu-financial-services-operations&ft:locale=en-US)
* [Retrieving specific records from a
  third-party source](https://www.servicenow.com/docs/access?context=remote-table-script-def-example2&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US)
* [v_query API](https://servicenow-prod.fluidtopics.net/lyJrNorP6Xisuyh64BcmNg#v_queryAPI "The v_query API provides methods to obtain information about a scriptable object that represents a query running against a remote table.")
{#v_table-addRow_O__ul_eyp_csw_rqb}
{#v_table-addRow_O__table_udd_bdj_nlb__entry__3}

| Name | Type | Description |
|-|-|-|
| row | Object | JavaScript object containing field name and value map in which the key is the field name, for example, `{number: "INC0001", sys_id: "a34"}`. { "<field name>": "value" } |
| row.\<field value\> | String | Represents 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: { "sys_id": "<uniqueID>" } |
[Table 1. Parameters]

{#v_table-addRow_O__table_udd_bdj_nlb} {#v_table-addRow_O__table_vdd_bdj_nlb__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the row was added to the remote table. Valid values: * true: Success. * false: Row was not added. {#v_table-addRow_O__ul_jdl_pfb_add} |
[Table 2. Returns]

{#v_table-addRow_O__table_vdd_bdj_nlb}  
The following example shows how to use the [RESTMessageV2](https://servicenow-prod.fluidtopics.net/GTICc0CILYzAeV000LsWeg#c_RESTMessageV2API "The RESTMessageV2 API provides methods that allow you to send outbound REST messages using JavaScript.") 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.

    (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);


