{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":204,"path":"api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md","title":"FetchConfiguration structure - iOS","bundle":null,"doc_type":null,"release":"australia","body":"\n# FetchConfiguration structure- iOS\n\nThe FetchConfiguration structure provides the ability to define the configuration for fetching records from your ServiceNow instance.\n\n<table id=\"table_vx2_klw_5pb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nfilter\n\n</td><td>\n\n[Filter](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FilteriOSStructure.md)\n\n</td><td>\n\nOptional. 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.\\)\n\n</td></tr><tr><td>\n\nlimit\n\n</td><td>\n\nInteger\n\n</td><td>\n\nOptional. Number of records to return per page/response.Default: nil - All records returned \\(any system or table limits are honored.\\)\n\n</td></tr><tr><td>\n\nreadConfiguration\n\n</td><td>\n\n[FieldReadConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldReadConfigurationiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration of the fields returned in the response.Default: nil - All fields are returned.\n\n</td></tr></tbody>\n</table>**Parent Topic:**[Mobile SDK - iOS](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/MobileSDKiOSAPI.md)\n\n## FetchConfiguration - init\\(filter: Filter? = nil, limit: Int? = nil, readConfiguration: FieldReadConfiguration? = nil\\)\n\nDefines the criteria for what records, and associated fields within those records, to return when fetching data from a ServiceNow instance through a REST endpoint.\n\n<table id=\"table_pgj_tg2_vpb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nfilter\n\n</td><td>\n\n[Filter](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FilteriOSStructure.md)\n\n</td><td>\n\nOptional. 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.\\)\n\n</td></tr><tr><td>\n\nlimit\n\n</td><td>\n\nInteger\n\n</td><td>\n\nOptional. Number of records to return per page/response.Default: nil - All records returned \\(any system or table limits are honored.\\)\n\n</td></tr><tr><td>\n\nreadConfiguration\n\n</td><td>\n\n[FieldReadConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldReadConfigurationiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration of the fields returned in the response.Default: nil - All fields are returned.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nShows how to configure the data to fetch from the Table API.\n\n```\n/// The configuration for what to fetch from the Table API.\nlazy var fetchConfiguration: FetchConfiguration = {\n  let includeFields = [\n    // Case details\n    \"number\",\n    \"short_description\",\n    \"priority\",\n    \"state\",\n    \"opened_at\",\n    \n    // Account details\n    \"account.name\",\n    \"account.number\",\n    \"contact.name\",\n    \"contact.email\",\n    \"contact_type\",\n\n    // Assignment\n    \"assignment_group.name\",\n    \"assigned_to.name\"\n  ]\n  let readConfiguration = FieldReadConfiguration(includeFields: includeFields, options: .actualValues)\n  let filter = Filter(criteria: [], sortBy: [.desc(\"number\")], queryCategory: nil)\n  return FetchConfiguration(filter: filter, limit: 10, readConfiguration: readConfiguration)\n}()\n```\n\n"}}