---
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


---

# NowTableService interface - Android

# NowTableService interface - Android {#ariaid-title1}

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

The NowTableService interface provides functions that enable you to
create, read, delete, and update records within a table on a ServiceNow
instance.
{#NowTableServiceAndroidInterface__table_vx2_klw_5pb__entry__3}

| Name | Type | Description |
|-|-|-|
| configuration | [NowServiceConfiguration](https://servicenow-prod.fluidtopics.net/Csuh2Bp1F37gr9cX8Z4xFg "The NowServiceConfiguration class enables you to configure the ServiceNow instance URL and package name for a feature service.") | Configuration to associate with the service. |
[Table 1. Properties]

{#NowTableServiceAndroidInterface__table_vx2_klw_5pb}

## NowTableService - createRecord(tableName: String, fields: Map\<String, String\>,
writeOptions: FieldWriteOptions?, configuration: FieldReadConfiguration?) {#ariaid-title2}

Inserts the specified record in the specified table.
{#NTabServ-createRecord_S_S_S__table_arm_j41_ppb__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | Name of the table in which to save the record. |
| fields | Map\<String, String\> | Key-value pairs for all fields to create in the record. Note: All fields within a record may not be available for update. For example, fields that have a prefix of `sys_` are typically system parameters that are automatically generated and cannot be updated. Fields that are not specified and not auto-generated by the system are set to the associated data type's null value. |
| writeOptions | [FieldWriteOptions](https://servicenow-prod.fluidtopics.net/Dg~uaBhCbajtcwU8UhBBDA#FieldWriteOptionsAndroidAPI "The FieldWriteOptions class provides functions that set the options for updating or creating fields in a record on a ServiceNow instance.") | Optional. Write options to set on the fields, such as whether the value should be stored as display values or whether to suppress auto generation of system fields. Default: null - No options selected |
| configuration | [FieldReadConfiguration](https://servicenow-prod.fluidtopics.net/ZwKYHR7SHJtt39lWEGvc8Q#FieldReadConfigAndroidAPI "The FieldReadConfiguration class provides the ability to define what fields to return or not return in a response record.") | Optional. Configuration that specifies which fields to return for the created record and what to include in the fields. |
[Table 2. Parameters]

{#NTabServ-createRecord_S_S_S__table_arm_j41_ppb} {#NTabServ-createRecord_S_S_S__table_brm_j41_ppb__entry__2}

| Type | Description |
|-|-|
| [Call](https://servicenow-prod.fluidtopics.net/QqQzdE2jNcRyZ9uTF8c1wg#CallAndroidInterface "The Call interface represents a request that is prepared for processing.")\<[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/)\> | Success: ByteArray that contains the created record. You can convert this information into any data model that you need. Failure: NowDataError |
[Table 3. Returns]

{#NTabServ-createRecord_S_S_S__table_brm_j41_ppb}  

    fun createTableRecord( tableName: String, fields: KeyValues, includeFields: String, 
      readOptions: ReadOptions?, writeOptions: WriteOptions?){ 
     
      val readOptionsArray = readOptions?.asArray() ?: arrayOf() 
      val readConfig = FieldReadConfiguration(includeFields.split(","), *readOptionsArray) 
     
      var body:ByteArray? 
     
      val call = tableService.createRecord(tableName, fields.toMap(), 
        writeOptions?.asFieldWriteOptions(), 
        readConfig) 
      call.enqueue({ body = it.body },{ Log.d("Records", "failed to create record") }) 
    } 

## NowTableService - deleteRecord(sysId: String, tableName: String) {#ariaid-title3}

Deletes the specified record in the specified table.
{#NTabServ-deleteRecord_S_S__table_esw_b1h_ppb__entry__3}

| Name | Type | Description |
|-|-|-|
| sysId | String | Sys_id of the record to delete. |
| tableName | String | Name of the table in which the specified record is located, such as incident or asset. |
[Table 4. Parameters]

{#NTabServ-deleteRecord_S_S__table_esw_b1h_ppb} {#NTabServ-deleteRecord_S_S__table_fsw_b1h_ppb__entry__2}

| Type | Description |
|-|-|
| [Call](https://servicenow-prod.fluidtopics.net/QqQzdE2jNcRyZ9uTF8c1wg#CallAndroidInterface "The Call interface represents a request that is prepared for processing.")\<[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/)\> | Success: Nothing is returned. Failure: NowDataError |
[Table 5. Returns]

{#NTabServ-deleteRecord_S_S__table_fsw_b1h_ppb}  
<br />

    fun deleteTableRecord( recordSysId: String, tableName: String, callType: CallTestType){ 
      val tableService = serviceProvider.tableService()
      var body:ByteArray? 
      val call = tableService.deleteRecord(recordSysId, tableName) 
      call.enqueue({ body = it.body },{ Log.d("Records", "failed to create record") }) 
    } 

## NowTableService - paginator(tableName: String, configuration: FetchConfiguration) {#ariaid-title4}

Creates a paginator that allows iteration of pages of records within a
table.
You can use this paginator to navigate through the returned records, performing navigation
operations such as fetching the first, last, previous, or next page, or checking whether
there is next or previous page.
{#NTabServ-paginator_S_O__table_o32_dbh_ppb__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | Name of the table for which to create the paginator. |
| configuration | [FetchConfiguration](https://servicenow-prod.fluidtopics.net/4W~ny7No0gvVhGjkEIAkVQ#FetchConfigAndroidAPI "The FetchConfiguration class provides the ability to define the configuration for fetching records from the associatedServiceNow table.") | Configuration that specified the filters to use, pagination page size limit, which fields to retrieve, and what to include in the fields. |
[Table 6. Parameters]

{#NTabServ-paginator_S_O__table_o32_dbh_ppb} {#NTabServ-paginator_S_O__table_p32_dbh_ppb__entry__2}

| Type | Description |
|-|-|
| Paginator​\<[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/)\> | Success: Paginator with ByteArray output of the requested records. You can use the functions within the Paginator object to navigate the returned records. Failure: NowDataError |
[Table 7. Returns]

{#NTabServ-paginator_S_O__table_p32_dbh_ppb}  
<br />

    private fun initTablePaginator() { 
      paginator = service?.paginator(tableName, FetchConfiguration(null, 3)) 
        ?.observe(object: PaginatorCallBack<ByteArray> { 
          override fun onSuccess(response: Response<List<ByteArray>>) { 
          } 
          override fun onFailure(e: NowDataError) { 
            Log.e("NowDataError", "", e) 
          } 
        }) 
    }

## NowTableService - record(sysId: String, tableName: String, configuration:
FieldReadConfiguration?) {#ariaid-title5}

Retrieves the specified record from the specified table.
{#NTabServ-record_S_S_O__table_sdk_wch_ppb__entry__3}

| Name | Type | Description |
|-|-|-|
| sysId | String | Sys_id of the record to retrieve. |
| tableName | String | Name of the table in which the specified record is located, such as incident or asset. |
| configuration | [FieldReadConfiguration](https://servicenow-prod.fluidtopics.net/ZwKYHR7SHJtt39lWEGvc8Q#FieldReadConfigAndroidAPI "The FieldReadConfiguration class provides the ability to define what fields to return or not return in a response record.") | Optional. Configuration that specifies which fields to retrieve and what to include in the fields. |
[Table 8. Parameters]

{#NTabServ-record_S_S_O__table_sdk_wch_ppb} {#NTabServ-record_S_S_O__table_tdk_wch_ppb__entry__2}

| Type | Description |
|-|-|
| [Call](https://servicenow-prod.fluidtopics.net/QqQzdE2jNcRyZ9uTF8c1wg#CallAndroidInterface "The Call interface represents a request that is prepared for processing.")​\<[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/)\> | Success: ByteArray that contains the retrieved record. You can convert this information into any data model that you need. Failure: NowDataError |
[Table 9. Returns]

{#NTabServ-record_S_S_O__table_tdk_wch_ppb}  
<br />

    fun fetchTableRecord( sysId: String, tableName: String, includeFields: String, 
      readOptions: ReadOptions?){ 
     
      val readOptionsArray = readOptions?.asArray() ?: arrayOf() 
      val readConfig = FieldReadConfiguration(includeFields.split(","), *readOptionsArray) 
     
      var body:ByteArray? 
     
      val call = tableService.record(sysId, tableName, readConfig) 
      call.enqueue({ body = it.body },{ Log.d("Record", "failed fetching record") }) 
    }

## NowTableService - records(tableName: String, configuration:
FieldReadConfiguration?) {#ariaid-title6}

Retrieves sll records record from the specified table.
{#NTabServ-records_S_S_O__table_if5_v2h_ppb__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | Name of the table from which to retrieve the records, such as incident or asset. |
| configuration | [FieldReadConfiguration](https://servicenow-prod.fluidtopics.net/ZwKYHR7SHJtt39lWEGvc8Q#FieldReadConfigAndroidAPI "The FieldReadConfiguration class provides the ability to define what fields to return or not return in a response record.") | Optional. Configuration that specifies which fields to retrieve and what to include in the fields. |
[Table 10. Parameters]

{#NTabServ-records_S_S_O__table_if5_v2h_ppb} {#NTabServ-records_S_S_O__table_jf5_v2h_ppb__entry__2}

| Type | Description |
|-|-|
| [Call](https://servicenow-prod.fluidtopics.net/QqQzdE2jNcRyZ9uTF8c1wg#CallAndroidInterface "The Call interface represents a request that is prepared for processing.")​\<[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/)\> | Success: ByteArray that contains the retrieved records. You can convert this information into any data model that you need. Failure: NowDataError |
[Table 11. Returns]

{#NTabServ-records_S_S_O__table_jf5_v2h_ppb}  
<br />

    fun fetchTableRecords( tableName: String, filterQuery: String, includeFields: String, 
      readOptions: ReadOptions?, limit: Int?){ 
     
      val readOptionsArray = readOptions?.asArray() ?: arrayOf() 
      val readConfig = FieldReadConfiguration(includeFields.split(","), *readOptionsArray) 
      val config = FetchConfiguration(Filter(filterQuery), limit, readConfig) 
     
      var body:ByteArray? 
     
      val call = tableService.records(tableName, config) 
      call.enqueue({ body = it.body },{ Log.d("Records", "failed fetching records") }) 
    } 

## NowTableService - updateRecord(sysId: String, tableName: String, fields: Map\<String,
String\>, writeOptions: FieldWriteOptions?, configuration: FieldReadConfiguration?) {#ariaid-title7}

Updates the specified record in the specified table with the specified
fields.
{#NTabServ-updateRecord_S_S_S_O__table_jtj_nfh_ppb__entry__3}

| Name | Type | Description |
|-|-|-|
| tableName | String | Name of the table in which to update the record. |
| fields | Map\<String, String\> | Key-value pairs for all fields to update in the record. Note: All fields within a record may not be available for update. For example, fields that have a prefix of `sys_` are typically system parameters that are automatically generated and cannot be updated. Fields that are not specified and not auto-generated by the system are set to the associated data type's null value. |
| writeOptions | [FieldWriteOptions](https://servicenow-prod.fluidtopics.net/Dg~uaBhCbajtcwU8UhBBDA#FieldWriteOptionsAndroidAPI "The FieldWriteOptions class provides functions that set the options for updating or creating fields in a record on a ServiceNow instance.") | Optional. Write options to set on the fields, such as whether the value should be stored as display values or whether to suppress auto generation of system fields. Default: null - No options selected |
| configuration | [FieldReadConfiguration](https://servicenow-prod.fluidtopics.net/ZwKYHR7SHJtt39lWEGvc8Q#FieldReadConfigAndroidAPI "The FieldReadConfiguration class provides the ability to define what fields to return or not return in a response record.") | Optional. Configuration that specifies which fields to update and what to include in the fields. Default: null |
[Table 12. Parameters]

{#NTabServ-updateRecord_S_S_S_O__table_jtj_nfh_ppb} {#NTabServ-updateRecord_S_S_S_O__table_ktj_nfh_ppb__entry__2}

| Type | Description |
|-|-|
| [Call](https://servicenow-prod.fluidtopics.net/QqQzdE2jNcRyZ9uTF8c1wg#CallAndroidInterface "The Call interface represents a request that is prepared for processing.")​\<[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/)\> | Success: ByteArray that contains the updated record. You can convert this information into any data model that you need. Failure: NowDataError |
[Table 13. Returns]

{#NTabServ-updateRecord_S_S_S_O__table_ktj_nfh_ppb}  
<br />

    fun updateTableRecord( sysId: String, tableName: String, fields: KeyValues, includeFields: String, 
       readOptions: ReadOptions?, writeOptions: WriteOptions?){ 
     
       val readOptionsArray = readOptions?.asArray() ?: arrayOf() 
       val readConfig = FieldReadConfiguration(includeFields.split(","), *readOptionsArray) 
     
       var body:ByteArray? 
     
       val call = tableService.updateRecord(recordSysId, tableName, fields.toMap(), 
         writeOptions?.asFieldWriteOptions(), 
         readConfig) 
       call.enqueue({ body = it.body },{ Log.d("Records", "failed to update record") }) 
    }


