FieldReadConfiguration class- Android
The FieldReadConfiguration class provides the ability to define what fields to return or not return in a response record.
| Name | Type | Description |
|---|---|---|
| includeFields | Collection<String> | Fields to return in the response. |
| queryItems | Map<String, String> | Read-only. Collection of query items representing the read configuration. |
| queryParams | QueryParams | Iterable structure that contains name-value pairs of request query parameters. Use these parameters to build a request. |
Parent Topic:Mobile SDK - Android
FieldReadConfiguration - FieldReadConfiguration(includeFields: Collection<String> = listOf(), vararg options: FieldReadConfiguration.Options)
Defines the fields to include in the return response from the associated ServiceNow table.
| Name | Type | Description |
|---|---|---|
| includeFields | Collection<String> | List of comma-separated fields to return in the response. If the list is empty, all fields are returned. |
| vararg options | FieldReadConfiguration.Options | Optional. Array of zero or more options that define the type of field information to return.Possible values: - ACTUAL\_VALUES: Include the field's actual value in the response. - DISPLAY\_VALUES: Include the field's display value in the response. - EXCLUDE\_REFERENCE\_LINK: Exclude the Table API links for the reference fields. |
The following code example shows how to call this function.
val readConfiguration = FieldReadConfiguration(
includeFields = listOf("sys_id", "sys_created_on", "short_description"),
options = arrayOf(FieldReadConfiguration.Options.DISPLAY_VALUES)
)
val fetchConfiguration = FetchConfiguration(
filter = Filter("active=true"),
readConfiguration = readConfiguration
)
val response = nowTableService.records("incident", fetchConfiguration).execute()
handleResponse(response)