FieldReadConfiguration class - Android

  • Release version: Xanadu
  • Updated August 1, 2024
  • 1 minute to read
  • The FieldReadConfiguration class provides the ability to define what fields to return or not return in a response record.

    Table 1. Properties
    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.

    FieldReadConfiguration - FieldReadConfiguration(includeFields: Collection<String> = listOf(), vararg options: FieldReadConfiguration.Options)

    Defines the fields to include in the return response from the associated ServiceNow table.

    Table 2. Parameters
    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)