Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

FetchConfiguration structure- iOS

The FetchConfiguration structure provides the ability to define the configuration for fetching records from your ServiceNow instance.

NameTypeDescription
filterFilterOptional. Query to apply to the return results. For example, to return only active records with a short description that contains the word "broken", pass the following query: `active=true^short_descriptionLIKEbroken`Default: nil - No filter applied, all records returned \(any system or table limits are honored.\)
limitIntegerOptional. Number of records to return per page/response.Default: nil - All records returned \(any system or table limits are honored.\)
readConfigurationFieldReadConfigurationOptional. Configuration of the fields returned in the response.Default: nil - All fields are returned.

Parent Topic:Mobile SDK - iOS

FetchConfiguration - init(filter: Filter? = nil, limit: Int? = nil, readConfiguration: FieldReadConfiguration? = nil)

Defines the criteria for what records, and associated fields within those records, to return when fetching data from a ServiceNow instance through a REST endpoint.

NameTypeDescription
filterFilterOptional. Query to apply to the return results. For example, to return only active records with a short description that contains the word "broken", pass the following query: `active=true^short_descriptionLIKEbroken`Default: nil - No filter applied, all records returned \(any system or table limits are honored.\)
limitIntegerOptional. Number of records to return per page/response.Default: nil - All records returned \(any system or table limits are honored.\)
readConfigurationFieldReadConfigurationOptional. Configuration of the fields returned in the response.Default: nil - All fields are returned.
TypeDescription
None 

Shows how to configure the data to fetch from the Table API.

/// The configuration for what to fetch from the Table API.
lazy var fetchConfiguration: FetchConfiguration = {
  let includeFields = [
    // Case details
    "number",
    "short_description",
    "priority",
    "state",
    "opened_at",

    // Account details
    "account.name",
    "account.number",
    "contact.name",
    "contact.email",
    "contact_type",

    // Assignment
    "assignment_group.name",
    "assigned_to.name"
  ]
  let readConfiguration = FieldReadConfiguration(includeFields: includeFields, options: .actualValues)
  let filter = Filter(criteria: [], sortBy: [.desc("number")], queryCategory: nil)
  return FetchConfiguration(filter: filter, limit: 10, readConfiguration: readConfiguration)
}()