{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":265,"path":"api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md","title":"NowTableService class - iOS","bundle":null,"doc_type":null,"release":"australia","body":"\n# NowTableService class- iOS\n\nThe NowTableService class provides functions that enable you to perform create, read, update, and delete operations on records of existing ServiceNow tables.\n\n|Name|Type|Description|\n|----|----|-----------|\n|configuration|[NowServiceConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowServiceConfigurationiOSStruct.md)|Configuration settings provided when the service was initialized.|\n\n**Parent Topic:**[Mobile SDK - iOS](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/MobileSDKiOSAPI.md)\n\n## NowTableService - create&lt;Model: SysIdentifiableModel&gt;\\(\\_ model: Model, in tableName: String, coder: Coder, writeOptions: FieldWriteOptions, configuration: FetchConfiguration\\) async throws\n\nInserts the specified Codable model into the specified table.\n\nIn order to create a new record by model, the model must conform to the `SysIdentifiableModel` protocol. Each table will typically have its own model.\n\nThe model's **sys\\_Id** parameter is ignored during creation as the **sysId** is generated by the ServiceNow platform. The ServiceNow platform generated **sys\\_Id** is returned in the **completion** handler's `Result` model.\n\n<table id=\"table_tqk_gsk_spb\" 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\nmodel\n\n</td><td>\n\nSysIdentifiableModel\n\n</td><td>\n\nModel definition of the fields to insert into the table.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_uqk_gsk_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nModel\n\n</td><td>\n\nReturned when the method is successful. Codable model that was inserted in the specified table, including the sys\\_Id. Use this sys\\_id to reference this record in future method calls.\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails. -   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code example shows how to call this method.\n\n```\nstruct User: SysIdentifiableModel {\n    var sysId: String = \"\"\n    var name: String\n}\n\nlet service: NowTableService = ...\nlet user = User(name: \"Ash Williams\")\ndo {\n    let result = try await service.create(user, in: “sys_user”)\n} catch {\n    ...\n}\n```\n\n## NowTableService - create&lt;Model: SysIdentifiableModel&gt;\\(\\_ model: Model, in tableName: String, coder: Coder, writeOptions: FieldWriteOptions, configuration: FetchConfiguration, completion: @escaping \\(Result&lt;Model, NowDataError&gt;\\)\\)\n\nInserts the specified Codable model into the specified table and then executes the **completion** handler.\n\nIn order to create a new record by model, the model must conform to the `SysIdentifiableModel` protocol. Each table will typically have its own model. For example:\n\n```\nstruct User: SysIdentifiableModel {\n  var sysId: String = \"\"\n  var name: String\n}\n\nlet service: NowTableService = ...\nlet user = User(name: \"Ash Williams\")\nservice.create(Incident(fields: fields), in: tableName, writeOptions: writeOptions, configuration: fetchConfiguration) { [weak self] result in\n  switch result {\n  case .success(let newUser):\n    /// 'newUser' contains the platform assigned 'sys_id', use in subsequent 'update' or 'delete' calls.\n  case .failure(let error):\n      ...\n  }\n}\n```\n\nThe model's **sys\\_Id** parameter is ignored during creation as the **sysId** is generated by the ServiceNow platform. The ServiceNow platform generated **sys\\_Id** is returned in the **completion** handler's `Result` model.\n\n<table id=\"table_tqk_gsk_spb\" 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\nmodel\n\n</td><td>\n\nSysIdentifiableModel\n\n</td><td>\n\nModel definition of the fields to insert into the table.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Model, NowDataError&gt;\\)\n\n</td><td>\n\nCompletion handler to execute after creating the specified decodable model\\(s\\).Return values for the completion handler:\n\n-   Success: Model - Data for the created model type.\n-   Failure: NowDataError\n    -   `accessToken(AccessTokenProviderError)`\n\n        -   **AccessTokenProviderError**: The access token provider's error code or message.\n            -   accessTokenRetrievalFailed\n            -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n    -   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n    -   `badResponse(statusCode: HTTPStatusCode)`\n\n        -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n    -   `cannotDecodeModel(DecodingError)`\n\n        -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n    -   `cannotDecodeProperty(type: Any, from: String)`\n\n        -   **type**: Wrapped type to decode from a string.\n        -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n    -   `cannotEncodeModel(EncodingError)`\n\n        -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n    -   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n    -   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n    -   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n    -   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n    -   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n    -   `network(NetworkServiceError)`\n\n        -   genericError\\(String\\)\n        -   operationCanceled\n        -   service​Disabled\n        -   serverError\\(Error\\)\n        -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\n```\nstruct User: SysIdentifiableModel {\n  var sysId: String = \"\"\n  var name: String\n}\n\nlet service: NowTableService = ...\nlet user = User(name: \"Ash Williams\")\nservice.create(Incident(fields: fields), in: tableName, writeOptions: writeOptions, configuration: fetchConfiguration) { [weak self] result in\n  switch result {\n  case .success(let newUser):\n    /// 'newUser' contains the platform assigned 'sys_id' to use in subsequent update or delete calls.\n  case .failure(let error):\n   ...\n  }\n}\n```\n\n## NowTableService - create&lt;Model: SysIdentifiableModel&gt;\\(model: Model, in tableName: String, path: String = Constants.resultPath, coder: Coder = .default, writeOptions: FieldWriteOptions? = nil, configuration: FetchConfiguration = nil\\)\n\nInserts one Codable model into the specified table.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\nIn order to create a new record by model, the model must conform to the `SysIdentifiableModel` protocol. Each table will typically have its own model. For example:\n\n```\nstruct User: SysIdentifiableModel {\n  var sysId: String = \"\"\n  var name: String\n}\n\nlet service: NowTableService = ...\nlet user = User(name: \"Ash Williams\")\nservice.create(Incident(fields: fields), in: tableName, writeOptions: writeOptions, configuration: fetchConfiguration) { [weak self] result in\n  switch result {\n  case .success(let newUser):\n    /// 'newUser' contains the platform assigned 'sys_id', use in subsequent 'update' or 'delete' calls.\n  case .failure(let error):\n      ...\n  }\n}\n```\n\n**Note:** The model's **sys\\_Id** parameter is ignored during creation. The **sysId** is assigned by the ServiceNow platform. The ServiceNow platform generated **sys\\_Id** is returned in the publisher's `receiveValue` callback model.\n\n<table id=\"table_pnc_xkk_spb\" 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\nmodel\n\n</td><td>\n\nSysIdentifiableModel\n\n</td><td>\n\n`SysIdentifiableModel` model to insert into the table.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\npath\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Dot separated path for the nested type. For example, `result` or `foo.bar.baz` for deeper nesting.Default: `Constants.resultPath`\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_qnc_xkk_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Model,NowDataError&gt;\n\n</td><td>\n\nSuccess: Codable model that was inserted in the specified table, including **sys\\_Id**. Use this sys\\_id to reference this record in future method calls.Failure: NowDataError\n\n@escaping \\(Result&lt;Model, NowDataError&gt;\\)\n\n</td></tr></tbody>\n</table>Shows how to insert a single record into the User \\[sys\\_user\\] table.\n\n```\nstruct User: SysIdentifiableModel {\n  var sysId: String = \"\"\n  var name: String\n}\n\nlet service: NowTableService = ...\nlet user = User(name: \"Ash Williams\")\nlet publisher: AnyPublisher<User, NowDataError> = service.create(user, in: \"sys_user\")\npublisher\n  .subscribe(on: DispatchQueue.global())\n  .receive(on: DispatchQueue.main)\n  .sink { [weak self] completion in\n    ...\n  } receiveValue: { [weak self] newUser in\n      /// 'newUser' contains the ServiceNow platform assigned 'sys_id' to use in subsequent update and delete calls.\n     ...\n  }\n  .store(in: &subscriptions)\n```\n\n## NowTableService - createRecord\\(with fields: \\[FieldName: FieldValue\\], in tableName: String, writeOptions: FieldWriteOptions? = nil, configuration: FieldReadConfiguration? = nil\\) async throws\n\nInserts a record in the specified table that contains the specified fields.\n\nThe publisher emits data that you can decode into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can also use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\n**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.\n\n<table id=\"table_lww_l4j_ppb\" 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\nwith fields\n\n</td><td>\n\n\\[FieldName: FieldValue\\]\n\n</td><td>\n\nName-value pairs of the fields to include in the record.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_mww_l4j_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nData\n\n</td><td>\n\nReturned when the method is successful. Data object containing the new record.\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails. -   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code examples shows how to call this method.\n\n```\ndo {\n    let dataResult: Data = try await tableService.createRecord(with: fields, in: tableName, writeOptions: writeOptions, configuration: configuration)\n    let recordResult: NowRecord = dataResult.convertToRecord()\n} catch {\n    print(\"Record creation failed with NowDataError: \\(error)\")\n}\n```\n\n## NowTableService - createRecord\\(with fields: \\[FieldName: FieldValue\\], in tableName: String, writeOptions: FieldWriteOptions, configuration: FieldReadConfiguration, completion: @escaping \\(Result&lt;Data, NowDataError&gt;\\)\n\nInserts the specified record in the specified table and then executes the **completion** handler after the record is saved.\n\nIf needed, you can decode the return results into a custom Codable model or you can use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function instead. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myResult.convertToRecords()\n```\n\n**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.\n\n<table id=\"table_vk3_yqj_ppb\" 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\nwith fields\n\n</td><td>\n\n\\[FieldName: FieldValue\\]\n\n</td><td>\n\nName-value pairs of the fields to include in the record.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\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 options that specify which fields to return and what to include in the fields.Default: nil\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Data, NowDataError&gt;\\)\n\n</td><td>\n\nCompletion handler to execute after the records are retrieved. Return values:\n\n-   Success: Data - Requested records\n-   Error: NowDataError\n    -   `accessToken(AccessTokenProviderError)`\n\n        -   **AccessTokenProviderError**: The access token provider's error code or message.\n            -   accessTokenRetrievalFailed\n            -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n    -   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n    -   `badResponse(statusCode: HTTPStatusCode)`\n\n        -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n    -   `cannotDecodeModel(DecodingError)`\n\n        -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n    -   `cannotDecodeProperty(type: Any, from: String)`\n\n        -   **type**: Wrapped type to decode from a string.\n        -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n    -   `cannotEncodeModel(EncodingError)`\n\n        -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n    -   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n    -   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n    -   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n    -   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n    -   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n    -   `network(NetworkServiceError)`\n\n        -   genericError\\(String\\)\n        -   operationCanceled\n        -   service​Disabled\n        -   serverError\\(Error\\)\n        -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThe following code example shows how to call this function.\n\n```\nlet fields = [\"short_description\" : \"test description\"]\nlet writeOptions: FieldWriteOptions = [.suppressAutoSysField, .treatInputValuesAsDisplayValues]\nlet readConfiguration = FieldReadConfiguration(includeFields: [\"number\", \"short_description\"])\n\ntableService.createRecord(with: fields, in: tableName, writeOptions: writeOptions, configuration: readConfiguration) { [weak self] result in\n  switch result {\n    case .success(let dataResult):\n      let recordResult: NowRecord = dataResult.convertToRecord()\n    case .failure(let error):\n       print(\"Record creation failed with NowDataError: \\(error)\")\n  }\n}\n```\n\n## NowTableService - createRecord\\(with fields: \\[FieldName: FieldValue\\], in tableName: String, writeOptions: FieldWriteOptions? = nil, configuration: FieldReadConfiguration? = nil\\)\n\nInserts a record in the specified table that contains the specified fields.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\nThe publisher emits data that you can decode into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can also use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\n**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.\n\n<table id=\"table_lww_l4j_ppb\" 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\nwith fields\n\n</td><td>\n\n\\[FieldName: FieldValue\\]\n\n</td><td>\n\nName-value pairs of the fields to include in the record.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_mww_l4j_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Data, NowDataError&gt;\n\n</td><td>\n\nSuccess: Data object containing the updated record.Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>This example shows how to create a function that inserts a record in the specified table, with the specified fields. The output of the call is a ByteArray which allows you to convert the data into any model that you want.\n\n```\ntableService.createRecord(with: fields, in: tableName, writeOptions: writeOptions, configuration: readConfiguration)\n    .subscribe(on: DispatchQueue.global())\n    .receive(on: DispatchQueue.main)\n    .convertToRecord()\n    .sink { completion in\n        if case let .failure(error) = completion {\n            print(\"Record creation failed with NowDataError: \\(error)\")\n        }\n    } receiveValue: { record in\n        print(\"Created NowRecord: \\(record)\")\n    }\n    .store(in: &subscriptions)\n```\n\n## NowTableService - delete\\(\\_ model: Model, from tableName: String\\) async throws\n\nDeletes the specified Codable model from the specified table.\n\n|Name|Type|Description|\n|----|----|-----------|\n|model|Model|`SysIdentifiableModel` to delete from the table. It should contain the sys\\_id of the record to delete.|\n|from tableName|String|Name of the table from which to delete the information, such as incident.|\n\n<table id=\"table_rvl_lzk_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nNone\n\n</td><td>\n\nNothing returned when the method is successful.\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails. -   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code examples shows how to call this method.\n\n```\ndo { \n    try await tableService.delete(model, from: tableName)\n    print(\"Deletion successful.\")\n} catch {\n    print(\"Deletion failed with NowDataError: \\(error)\")\n}\n```\n\n## NowTableService - delete\\(\\_ model: Model, from tableName: String, completion: @escaping \\(Result&lt;Void, NowDataError&gt;\\)\\)\n\nDeletes the specified Codable model from the specified table and then executes the appropriate **completion** handler.\n\n<table id=\"table_zss_k1l_spb\" 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\nmodel\n\n</td><td>\n\nModel\n\n</td><td>\n\n`SysIdentifiableModel` to delete from the table. It should contain the sys\\_id of the record to delete.\n\n</td></tr><tr><td>\n\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table from which to delete the information, such as incident.\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Void, NowDataError&gt;\\)\n\n</td><td>\n\nCompletion handler to execute after deleting the specified codable model\\(s\\).Return values:\n\n-   Success: Nothing returned\n-   Failure: NowDataError\n    -   `accessToken(AccessTokenProviderError)`\n\n        -   **AccessTokenProviderError**: The access token provider's error code or message.\n            -   accessTokenRetrievalFailed\n            -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n    -   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n    -   `badResponse(statusCode: HTTPStatusCode)`\n\n        -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n    -   `cannotDecodeModel(DecodingError)`\n\n        -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n    -   `cannotDecodeProperty(type: Any, from: String)`\n\n        -   **type**: Wrapped type to decode from a string.\n        -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n    -   `cannotEncodeModel(EncodingError)`\n\n        -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n    -   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n    -   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n    -   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n    -   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n    -   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n    -   `network(NetworkServiceError)`\n\n        -   genericError\\(String\\)\n        -   operationCanceled\n        -   service​Disabled\n        -   serverError\\(Error\\)\n        -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThe following code example shows how to call this function.\n\n```\ntableService.delete(Incident(sysId: sysId), from: tableName) { [weak self] result in\n  switch result {\n    case .success:\n      // Delete successfully\n    case .failure(let error):\n      // Failed to delete with NowDataError\n  }\n}\n```\n\n## NowTableService - delete\\(\\_ model: Model, from tableName: String\\)\n\nDeletes the specified Codable model from the specified table.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\n|Name|Type|Description|\n|----|----|-----------|\n|model|Model|`SysIdentifiableModel` to delete from the table. It should contain the sys\\_id of the record to delete.|\n|from tableName|String|Name of the table from which to delete the information, such as incident.|\n\n<table id=\"table_rvl_lzk_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Void, NowDataError&gt;\n\n</td><td>\n\nSuccess: Nothing returnedFailure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code example shows how to call this function.\n\n```\ntableService.delete(Incident(sysId: sysId), from: tableName)\n  .subscribe(on: DispatchQueue.global())\n  .receive(on: DispatchQueue.main)\n  .sink { [weak self] completion in\n    switch completion {\n      case .finished:\n        // Delete successfully\n      case .failure(let error):\n        // Failed to delete with NowDataError\n    }\n  } receiveValue: { _ in\n  }\n  .store(in: &subscriptions)\n\n```\n\n## NowTableService - deleteRecord\\(sysId: SysID, from tableName: String\\) async throws\n\nDeletes the specified record from the specified table.\n\n|Name|Type|Description|\n|----|----|-----------|\n|sysId|String|Sys\\_id of the record to delete.|\n|from tableName|String|Name of the table from which to delete the information, such as incident.|\n\n<table id=\"table_ovk_2vj_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nNone\n\n</td><td>\n\nNothing returned when the method is successful.\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails.-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code examples shows how to call this method.\n\n```\ndo {\n    try await tableService.deleteRecord(sysId: sysId, from: tableName)\n    print(\"Deletion successful.\")\n} catch {\n    print(\"Deletion failed with NowDataError: \\(error)\")\n}\n```\n\n## NowTableService - deleteRecord\\(sysId: SysID, from tableName: String, completion: @escaping \\(Result&lt;Void, NowDataError&gt;\\)\\)\n\nDeletes the specified record from the specified table and then executes the **completion** object after the record is deleted.\n\n<table id=\"table_krx_yvj_ppb\" 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\nsysId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the record to delete.\n\n</td></tr><tr><td>\n\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table from which to delete the information, such as incident.\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Void, NowDataError&gt;\\)\n\n</td><td>\n\nSuccess: Nothing is returned.Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThe following code example shows how to call this function.\n\n```\ntableService.deleteRecord(sysId: sysId, from: tableName) { [weak self] result in\n  switch result {\n    case .success:\n      // Delete successfully\n    case .failure(let error):\n      // Failed to delete with NowDataError\n  }\n}\n```\n\n## NowTableService - deleteRecord\\(sysId: SysID, from tableName: String\\)\n\nDeletes the specified record from the specified table.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\n|Name|Type|Description|\n|----|----|-----------|\n|sysId|String|Sys\\_id of the record to delete.|\n|from tableName|String|Name of the table from which to delete the information, such as incident.|\n\n<table id=\"table_ovk_2vj_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Void, NowDataError&gt;\n\n</td><td>\n\nSuccess: Nothing returnedFailure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>This example shows how to create a function that deletes a record in a specified table.\n\n```\ntableService.deleteRecord(sysId: sysId, from: tableName) \n    .subscribe(on: DispatchQueue.global())\n    .receive(on: DispatchQueue.main)\n    .sink { completion in\n        switch completion {\n        case .finished:\n            print(\"Record deleted.\")\n        case .failure(let error):\n            print(\"Deletion failed with NowDataError: \\(error)\")\n        }\n    } receiveValue: { _ in }\n    .store(in: &subscriptions)\n```\n\n## NowServiceTable - init\\(configuration: NowServiceConfiguration, coreServiceProvider: NowCoreServiceProviding? = nil\\)\n\nCreates a NowTableService object.\n\n<table id=\"table_djd_fv3_ppb\" 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\nconfiguration\n\n</td><td>\n\n[NowServiceConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowServiceConfigurationiOSStruct.md)\n\n</td><td>\n\nConfiguration parameters to use when creating the service.\n\n</td></tr><tr><td>\n\ncoreServiceProvider\n\n</td><td>\n\nNowCoreServiceProviding\n\n</td><td>\n\nOptional. Service provider to associate with the NowTableService.Default: nil\n\n</td></tr></tbody>\n</table>The following code example shows how to call this function.\n\n```\nguard let coreService = NowSDK.core() else {\n  // Error with NowServiceError.sdkNotConfigured\n  return\n}\n\nguard \n  let instanceUrl = URL(string: \"http://sample.service-now.com\") , \n  let serviceConfig = NowSDK.makeServiceConfiguration(for: instanceUrl) else {\n    // Could not create service – \n    // NowServiceError.serviceConfigurationInvalid\n    return\n  }\nlet tableService = NowTableService (configuration: serviceConfig, coreServiceProvider: coreService)\n```\n\n## NowTableService - model&lt;Model: Decodable&gt;\\(with sysId: SysID? = nil, from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\) async throws\n\nEnables the retrieval of decodable model\\(s\\) from a specified table.\n\nTable API responses are nested inside a **result** parameter similar to the following:\n\n```\n{\n  \"result\": [\n    { \"name\": \"Ash Williams\" },\n    { \"name\": \"Lionel Cosgrove\" },\n    { \"name\": \"Laurie Strode\" }\n  ]\n}\n```\n\nFor large result sets, use one of the paginator functions, [NowTableService - paginator\\(from tableName: String, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) or [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) to fetch paginated models.\n\n<table id=\"table_nbq_yyj_spb\" 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\nwith sysId\n\n</td><td>\n\nSysID\n\n</td><td>\n\nOptional. Sys\\_id of the record to return. Provide the sys\\_id if you want to retrieve a specific record.Default: nil\n\n</td></tr><tr><td>\n\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\npath\n\n</td><td>\n\nString\n\n</td><td>\n\nDot separated path for the nested type. For example, `result` or `foo.bar.baz` for deeper nesting.Default: `result`\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_obq_yyj_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nModel\n\n</td><td>\n\nReturned when the method is successful. Decodable model\\(s\\).\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails. -   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code example shows how to call this method.\n\n```\nstruct User: Codable { \n    var name: String\n} \n\nlet service: NowTableService = ... \ndo {\n    let result = try await service.model([User].self, from: \"sys_user\", path: \"result\")\n    print(\"Fetched \\(users.count) users\")\n} catch {\n    dump(error) \n}\n```\n\nThe following code example shows how to fetch a single Decodable model by sys\\_id. Use a single model type, such as `User.self`, rather than `[User].self`.\n\n```\nlet result = try await service.model(User.self, with: \"5137153cc611227c000bbd1bd8cd2005\", from: \"sys_user\", path: \"result\") \n```\n\n## NowTableService - model&lt;Model: Decodable&gt;\\(\\_ type: Model.Type, with sysId: SysID? = nil, from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil, completion: @escaping \\(Result&lt;Model, NowDataError&gt;\\)\\)\n\nRetrieves decodable model\\(s\\) from a specified table.\n\nTable API responses are nested inside a **result** parameter similar to the following:\n\n```\n{\n  \"result\": [\n    { \"name\": \"Ash Williams\" },\n    { \"name\": \"Lionel Cosgrove\" },\n    { \"name\": \"Laurie Strode\" }\n  ]\n}\n```\n\nUse this function to obtain decodable models instead of nested output.\n\n<table id=\"table_trc_vfk_spb\" 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\ntype\n\n</td><td>\n\nModel.Type\n\n</td><td>\n\nType of value to decode.\n\n</td></tr><tr><td>\n\nwith sysId\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Sys\\_id of the record to return.Default: All records returned per the **configuration** settings.\n\n</td></tr><tr><td>\n\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\npath\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Dot separated path for the nested type. For example, `result` or `foo.bar.baz` for deeper nesting.Default: `Constants.resultPath`\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Default: `.default`\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Model, NowDataError&gt;\\)\n\n</td><td>\n\nCompletion handler to execute after retrieving the specified decodable model\\(s\\).Return values for the completion handler:\n\n-   Success: Data for the requested model type.\n-   Failure: NowDataError\n    -   `accessToken(AccessTokenProviderError)`\n\n        -   **AccessTokenProviderError**: The access token provider's error code or message.\n            -   accessTokenRetrievalFailed\n            -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n    -   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n    -   `badResponse(statusCode: HTTPStatusCode)`\n\n        -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n    -   `cannotDecodeModel(DecodingError)`\n\n        -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n    -   `cannotDecodeProperty(type: Any, from: String)`\n\n        -   **type**: Wrapped type to decode from a string.\n        -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n    -   `cannotEncodeModel(EncodingError)`\n\n        -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n    -   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n    -   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n    -   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n    -   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n    -   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n    -   `network(NetworkServiceError)`\n\n        -   genericError\\(String\\)\n        -   operationCanceled\n        -   service​Disabled\n        -   serverError\\(Error\\)\n        -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nTo retrieve a collection of decoded **User** models.\n\n```\nstruct User: SysIdentifiableModel {\n    var sysId: String = \"\"\n    var name: String\n}\nlet service: NowTableService = ...\nlet user = User(name: \"Ash Williams\")\nservice.create(Incident(fields: fields), in: tableName, writeOptions: writeOptions, configuration: fetchConfiguration) { [weak self] result in\n  switch result {\n  case .success(let newUser):\n    /// 'newUser' contains the platform assigned 'sys_id', use in subsequent 'update' or 'delete' calls.\n  case .failure(let error):\n   ...\n }\n}\n```\n\nTo fetch a single decodable model by sys\\_id, use a single model type, such as `User.self`, rather than `[User].self`.\n\n```\nservice.model(User.self, with: \"5137153cc611227c000bbd1bd8cd2005\", from: \"sys_user\", path: \"result\") { resultin ... }\n```\n\n## NowTableService - model&lt;Model: Decodable&gt;\\(with sysId: SysID? = nil, from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)\n\nCreates a publisher that enables the retrieval of decodable model\\(s\\) from a specified table.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\nTable API responses are nested inside a **result** parameter similar to the following:\n\n```\n{\n  \"result\": [\n    { \"name\": \"Ash Williams\" },\n    { \"name\": \"Lionel Cosgrove\" },\n    { \"name\": \"Laurie Strode\" }\n  ]\n}\n```\n\nFor large result sets, use one of the paginator functions, [NowTableService - paginator\\(from tableName: String, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) or [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) to fetch paginated models.\n\n<table id=\"table_nbq_yyj_spb\" 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\nwith sysId\n\n</td><td>\n\nSysID\n\n</td><td>\n\nOptional. Sys\\_id of the record to return. Provide the sys\\_id if you want to retrieve a specific record.Default: nil\n\n</td></tr><tr><td>\n\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\npath\n\n</td><td>\n\nString\n\n</td><td>\n\nDot separated path for the nested type. For example, `result` or `foo.bar.baz` for deeper nesting.Default: `result`\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_obq_yyj_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Model, NowDataError&gt;\n\n</td><td>\n\nSuccess: Publisher returning a decodable model\\(s\\).Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>To obtain a publisher that provides decoded User models by type, such as `[Users].self`, fetch the models by specifying a dot-separated path.\n\n```\nstruct User: Codable {\n  varname: String\n}\n\nlet service: NowTableService = ...\nlet publisher: AnyPublisher<[User], NowDataError> = service.model(from: \"sys_user\", path: \"user.photos.gps_location\")\n \n```\n\nTo fetch a single decodable model by sys\\_id, use a single `User.self` model type, rather than `[User].self`.\n\n```\nlet publisher: AnyPublisher<User, NowDataError> = service.model(with: \"5137153cc611227c000bbd1bd8cd2005\", from: \"sys_user\", path: \"result\")\n```\n\n## NowTableService - paginator\\(from tableName: String, configuration: FetchConfiguration? = nil\\)\n\nCreates a paginator that enables iterating through pages of records.\n\nThe paginator's publisher emits data that you can decode into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can also use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\n**Note:** Unless overridden in the **configuration** parameter, a paginator returns 20 items per page. Depending on ACL evaluation, the actual number of fetched items for a page might be less than the default or configured value.\n\n<table id=\"id_fpc_pcj_ppb\" 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 id=\"mobilesdkiOS-tableName-row\"><td>\n\ntableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_uwv_wv3_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nPaginator&lt;Data&gt;\n\n</td><td>\n\nSuccess: Paginator object containing the specified records.Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>```\nprivate var tableService: NowTableService?\n// Paginator creation uses type inference to determine the response type.\nprivate var paginator: Paginator<[CustomerServiceCase]>?\n\nfunc initializeTableService(for instanceUrl: URL) {\n  makeTableService(instanceUrl: instanceUrl) { [weak self] result in\n    guard let self = self else { return }\n            \n    switch result {\n    case .success(let tableService):\n      self.tableService = tableService\n      // Create a paginator that iterates over pages of customer support cases. The paginator's response type is\n      // inferred from the paginator's type definition (e.g. `Paginator<[CustomerServiceCase]>`).\n      self.paginator = tableService.paginator(from: Self.tableName, configuration: self.fetchConfiguration)\n      // Subscribe to the paginator's publisher so you are able to receive paged results.\n      self.subscribeToPaginatorPublisher()\n      // Ready to start fetching data, inform the view controller.\n      self.onReady(self)\n    case .failure(let error):\n      debugPrint(\"Creating table service failed with error: \\(error.localizedDescription)\")\n      self.tableService = nil\n      self.paginator = nil\n    }\n  }\n}\n```\n\n## NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)\n\nCreates a paginator that enables the iteration of pages of decoded model\\(s\\) that handle nesting.\n\nThe ServiceNow REST Table API responses are nested inside a result property similar to the following:\n\n```\n{\n  \"result\": [\n    { \"name\": \"Ash Williams\" },\n    { \"name\": \"Lionel Cosgrove\" },\n    { \"name\": \"Laurie Strode\" }\n  ]\n}\n```\n\nTo obtain a paginator that provides decoded User models, fetch the paginator by specifying a dot-separated path; in this case, **result**.\n\n```\nstruct User: Codable {\n  varname: String\n}\n\nlet service: NowTableService = ...\nlet paginator: Paginator<[User]> = service.paginator(from: \"sys_user\", path: \"result\")\n```\n\n**Note:** Unless overridden in the **configuration** parameter, a paginator returns 20 items per page. Depending on the ACL evaluations, the actual number of fetched items for a page might be less than the default or configured value.\n\nAfter obtaining a Paginator object, subscribe to its Combine Publisher to start receiving data:\n\n```\npaginator.publisher\n  .subscribe(on: DispatchQueue.global())\n  .receive(on: DispatchQueue.main)\n  .sink { … }\n  .store(in: &subscriptions)\n```\n\n**Note:** As with all Combine subscriptions, ensure that you retain the subscription to avoid unexpected results.\n\n<table id=\"table_vds_gtj_spb\" 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\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\npath\n\n</td><td>\n\nString\n\n</td><td>\n\nDot separated path for the nested type. For example, `result` or `result.user.photos` for deeper nesting. Specifying a custom path allows fetching or iterating over nested data*.*Default: `result`\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_wds_gtj_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nPaginator&lt;Data&gt;\n\n</td><td>\n\nSuccess: Paginator object containing paged `Decodable` model\\(s\\).Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>This example shows how to obtain a Paginator object that provides decoded User models. You can fetch the desired Paginator object by hinting the compiler to return a collection of User models \\(\\[User\\]\\) and informing the Paginator object that the users are nested beneath the result path.\n\n```\nstruct User: Codable {\n  var name: String\n}\n\nlet service: NowTableService = ...\nlet paginator: Paginator<[User]> = service.paginator(from: \"sys_user\", path: \"result\")\n```\n\n**Note:** The Table API always returns results nested beneath a result path, so you can safely eliminate the **path** parameter.\n\n## NowTableService - record\\(with sysId: SysID, from tableName: String, configuration: FieldReadConfiguration? = nil\\) async throws\n\nRetrieves a specified record from the specified table on a ServiceNow instance.\n\nThe publisher emits data that you can decode into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can also use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\n<table id=\"table_fsr_23j_ppb\" 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\nsysId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the record to return from the ServiceNow instance.\n\n</td></tr><tr><td>\n\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_gsr_23j_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nData\n\n</td><td>\n\nReturned when the method is successful. Data object containing the specified record.\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails. -   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code examples shows how to call this method.\n\n```\nfunc fetchTableRecord(sysId: String, tableName: String, includeFields: [FieldName] = [FieldName](), readOptions: FieldReadConfiguration.Options = []) async throws -> NowRecord {\n    let readConfig = FieldReadConfiguration(includeFields: includeFields, options: readOptions)\n    do {\n        let dataResult: Data = try await tableService.record(with: sysId, from: tableName, configuration: configuration)\n        let recordResult: NowRecord = dataResult.convertToRecord()\n        return recordResult\n    } catch {\n        print(\"Fetch failed with NowDataError: \\(error)\")\n        throw error\n    }\n}\n```\n\n## NowTableService - record\\(with sysId: SysID, from tableName: String, configuration: FieldReadConfiguration, completion: @escaping \\(Result&lt;Data, NowDataError&gt;\\)\n\nRetrieves the specified record from the specified table and then executes a completion handler after the record is retrieved.\n\nIf needed, you can decode the return results into a custom Codable model or you can use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function instead. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myResult.convertToRecords()\n```\n\nFor large result sets, use the [NowTableService - paginator\\(from tableName: String, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function to fetch paginated results.\n\n<table id=\"table_fzv_fnj_ppb\" 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\nsysId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the record to return from the ServiceNow instance.\n\n</td></tr><tr><td>\n\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Data, NowDataError&gt;\\)\n\n</td><td>\n\nCompletion handler to execute after the records are retrieved. Return values:\n\n-   Success: Data - Requested records\n-   Error: NowDataError\n    -   `accessToken(AccessTokenProviderError)`\n\n        -   **AccessTokenProviderError**: The access token provider's error code or message.\n            -   accessTokenRetrievalFailed\n            -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n    -   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n    -   `badResponse(statusCode: HTTPStatusCode)`\n\n        -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n    -   `cannotDecodeModel(DecodingError)`\n\n        -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n    -   `cannotDecodeProperty(type: Any, from: String)`\n\n        -   **type**: Wrapped type to decode from a string.\n        -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n    -   `cannotEncodeModel(EncodingError)`\n\n        -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n    -   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n    -   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n    -   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n    -   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n    -   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n    -   `network(NetworkServiceError)`\n\n        -   genericError\\(String\\)\n        -   operationCanceled\n        -   service​Disabled\n        -   serverError\\(Error\\)\n        -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThe following code example shows how to call this method.\n\n```\nfunc fetchTableRecords( tableName: String, filterQuery: String, includeFields: [FieldName] = [FieldName](), readOptions: FieldReadConfiguration.Options = [], limit: Int?) {\n  let readConfig = FieldReadConfiguration(includeFields: includeFields, options: readOptions)\n  let config = FetchConfiguration(Filter(query: filterQuery), limit, readConfig)\n  tableService.records (from: tableName, configuration: fetchConfiguration) { [weak self] result in\n    switch result {\n      case .success(let dataResult):\n        let recordResult: [NowRecord] = dataResult.convertToRecords()\n        // Return recordResult\n\n      case .failure(let error):\n        // Failed to fetch record with NowDataError\n    }\n  }\n}\n```\n\n## NowTableService - record\\(with sysId: SysID, from tableName: String, configuration: FieldReadConfiguration? = nil\\)\n\nCreates a publisher to retrieve a specified record from the specified table on a ServiceNow instance.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\nThe publisher emits data that you can decode into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can also use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\n<table id=\"table_fsr_23j_ppb\" 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\nsysId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the record to return from the ServiceNow instance.\n\n</td></tr><tr><td>\n\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_gsr_23j_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Data, NowDataError&gt;\n\n</td><td>\n\nSuccess: Data object containing the specified records.Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>This example shows how to create a function that retrieves the specified record from the specified table, with the specified fields. The output of the call is a ByteArray which allows you to convert the data into any model that you want.\n\n```\ntableService.record(with: sysId, from: tableName, configuration: fetchConfiguration)\n    .subscribe(on: DispatchQueue.global())\n    .receive(on: DispatchQueue.main)\n    .convertToRecord()\n    .sink { completion in\n        if case let .failure(error) = completion {\n            print(\"Record retrieval failed with NowDataError: \\(error)\")\n        }\n    } receiveValue: { record in\n        print(\"Successfully retrieved record: \\(record)\")\n    }\n    .store(in: &subscriptions)\n```\n\n## NowTableService - records\\(from tableName: String, configuration: FetchConfiguration? = nil\\) async throws\n\nRetrieves records from the specified table.\n\nThe publisher emits data that you can decode into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can also use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\nFor large result sets, use the [NowTableService - paginator\\(from tableName: String, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function to fetch paginated results.\n\n<table id=\"id_rzw_lcj_ppb\" 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\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_yvr_d1j_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nData\n\n</td><td>\n\nReturned when the method is successful. Data object containing the specified records.\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails. -   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code example shows how to call this method.\n\n```\nfunc fetchTableRecords( tableName: String, filterQuery: String,\n includeFields: [FieldName] = [FieldName](), readOptions:\n FieldReadConfiguration.Options = [], limit: Int?) {\n    let readConfig = FieldReadConfiguration(includeFields: includeFields, options: readOptions)\n    let config = FetchConfiguration(Filter(query: filterQuery), limit, readConfig)\n    do {\n      let dataResult: Data = try await tableService.records(from: tableName, configuration: config)\n      let recordResult: [NowRecord] = dataResult.convertToRecords()\n      // return recordResult\n    } catch {\n      print(\"Fetch failed with NowDataError: \\(error)\")\n      throw error \n  }\n}\n```\n\n## NowTableService - records\\(from tableName: String, configuration: FetchConfiguration? = nil, completion: @escaping \\(Result&lt;Data, NowDataError&gt;\\)\\)\n\nRetrieves records from a specified table and then executes the **completion** handler after the records are retrieved.\n\nIf needed, you can decode the return results into a custom Codable model or you can use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function instead. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myResult.convertToRecords()\n```\n\nFor large result sets, use the [NowTableService - paginator\\(from tableName: String, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function to fetch paginated results.\n\n<table id=\"table_uvc_y2j_ppb\" 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\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Data, NowDataError&gt;\\)\n\n</td><td>\n\nCompletion handler to execute after the records are retrieved. Return values:\n\n-   Success: Data - Requested records\n-   Error: NowDataError\n    -   `accessToken(AccessTokenProviderError)`\n\n        -   **AccessTokenProviderError**: The access token provider's error code or message.\n            -   accessTokenRetrievalFailed\n            -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n    -   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n    -   `badResponse(statusCode: HTTPStatusCode)`\n\n        -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n    -   `cannotDecodeModel(DecodingError)`\n\n        -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n    -   `cannotDecodeProperty(type: Any, from: String)`\n\n        -   **type**: Wrapped type to decode from a string.\n        -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n    -   `cannotEncodeModel(EncodingError)`\n\n        -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n    -   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n    -   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n    -   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n    -   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n    -   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n    -   `network(NetworkServiceError)`\n\n        -   genericError\\(String\\)\n        -   operationCanceled\n        -   service​Disabled\n        -   serverError\\(Error\\)\n        -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThe following code example shows how to call this method.\n\n```\nfunc fetchTableRecords( tableName: String, filterQuery: String, includeFields: [FieldName] = [FieldName](), readOptions: FieldReadConfiguration.Options = [], limit: Int?) {\n  let readConfig = FieldReadConfiguration(includeFields: includeFields, options: readOptions)\n  let config = FetchConfiguration(Filter(query: filterQuery), limit, readConfig)\n  tableService.records (from: tableName, configuration: fetchConfiguration) { [weak self] result in\n    switch result {\n      case .success(let dataResult):\n        let recordResult: [NowRecord] = dataResult.convertToRecords()\n        // return recordResult\n\n      case .failure(let error):\n        // Failed to fetch record with NowDataError\n    }\n  }\n}\n```\n\n## NowTableService - records\\(from tableName: String, configuration: FetchConfiguration? = nil\\)\n\nCreates a publisher that enable you to retrieve records from the specified table.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\nThe publisher emits data that you can decode into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can also use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\nFor large result sets, use the [NowTableService - paginator\\(from tableName: String, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function to fetch paginated results.\n\n<table id=\"id_rzw_lcj_ppb\" 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\nfrom tableName\n\n</td><td>\n\nString\n\n</td><td id=\"mobilesdkiOS-tableName-entry\">\n\nName of the table from which to retrieve the records, such as incident.\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_yvr_d1j_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Data, NowDataError&gt;\n\n</td><td>\n\nSuccess: Data object containing the specified records.Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>This example shows how to create a function that fetches multiple records from a specified table. It creates an object which will schedule the request to be executed at some point in the future and return a ByteArray response.\n\n```\ntableService.records(from: tableName, configuration: fetchConfiguration)\n    .subscribe(on: DispatchQueue.global())\n    .receive(on: DispatchQueue.main)\n    .convertToRecords()\n    .sink { completion in\n        if case let .failure(error) = completion {\n            print(\"Record retrieval failed with NowDataError: \\(error)\")\n        }\n    } receiveValue: { records in\n        print(\"Successfully retrieved records: \\(records)\")\n    }\n    .store(in: &subscriptions)\n```\n\n## NowTableService - update&lt;Model: SysIdentifiableModel&gt;\\(\\_ model: Model, in tableName: String, coder: Coder = .default, writeOptions: FieldWriteOptions? = nil, configuration: FetchConfiguration? = nil\\) async throws\n\nUpdates the specified Codable model in the specified table.\n\n<table id=\"table_n4q_3yk_spb\" 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\nmodel\n\n</td><td>\n\nModel\n\n</td><td>\n\n`SysIdentifiableModel` model to update in the table.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_o4q_3yk_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nModel\n\n</td><td>\n\nReturned when the method is successful. Decodable model that was updated in the specified table.\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails. -   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code examples shows how to call this method.\n\n```\nstruct User: SysIdentifiableModel {\n    var sysId: String = \"\"\n    var name: String}\n     \nfunc updateUser(user: User) async throws -> User {\n    do {\n        let result = try await tableService.update(user, in: “sys_user”)\n        return result\n    } catch {\n        print(\"Update failed with NowDataError: \\(error)\")\n        throw error\n    }\n}\n```\n\n## NowTableService - update&lt;Model: SysIdentifiableModel&gt;\\(\\_ model: Model, in tableName: String, coder: Coder = .default, writeOptions: FieldWriteOptions? = nil, configuration: FetchConfiguration? = nil, completion: @escaping \\(Result&lt;Model, NowDataError&gt;\\)\\)\n\nUpdates the specified Codable model in the specified table and then executes the **completion** handler.\n\n<table id=\"table_nmv_vpr_spb\" 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\nmodel\n\n</td><td>\n\nModel\n\n</td><td>\n\n`SysIdentifiableModel` model to update in the table.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Model, NowDataError&gt;\\)\n\n</td><td>\n\nCompletion handler to execute after updating the specified Codable model\\(s\\).Return values:\n\n-   Success: Model\n-   Failure: NowDataError\n    -   `accessToken(AccessTokenProviderError)`\n\n        -   **AccessTokenProviderError**: The access token provider's error code or message.\n            -   accessTokenRetrievalFailed\n            -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n    -   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n    -   `badResponse(statusCode: HTTPStatusCode)`\n\n        -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n    -   `cannotDecodeModel(DecodingError)`\n\n        -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n    -   `cannotDecodeProperty(type: Any, from: String)`\n\n        -   **type**: Wrapped type to decode from a string.\n        -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n    -   `cannotEncodeModel(EncodingError)`\n\n        -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n    -   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n    -   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n    -   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n    -   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n    -   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n    -   `network(NetworkServiceError)`\n\n        -   genericError\\(String\\)\n        -   operationCanceled\n        -   service​Disabled\n        -   serverError\\(Error\\)\n        -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThe following code example shows how to call this method.\n\n```\nstruct User: SysIdentifiableModel {\n  var sysId: String = \"\"\n  var name: String\n}\n\nlet user = User(sysId: \"12345\", name: \"abel\")\nlet coder: Coder = .default\n\ntableService.update(user, in: \"sys_user\") { [weak self] result in\n  switch result {\n    case .success(let model):\n      do {\n        let data = try coder.jsonEncoder.encode(model)\n        self?.publish(data: data)\n      } catch {\n        self?.publish(result: .failure(error))\n      }            \n    case .failure(let error):\n      // Failed to update with NowDataError\n      self?.publish(result: .failure(error))\n  }\n}\n```\n\n## NowTableService - update&lt;Model: SysIdentifiableModel&gt;\\(\\_ model: Model, in tableName: String, coder: Coder = .default, writeOptions: FieldWriteOptions? = nil, configuration: FetchConfiguration? = nil\\)\n\nUpdates the specified codable model in the specified table.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\n<table id=\"table_n4q_3yk_spb\" 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\nmodel\n\n</td><td>\n\nModel\n\n</td><td>\n\n`SysIdentifiableModel` model to update in the table.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\ncoder\n\n</td><td>\n\nCoder\n\n</td><td>\n\nOptional. `Coder` to use to encode or decode data sent to and received from the ServiceNow instance.Possible values:\n\n-   default: The default encoders format dates using the `yyy-MM-dd HH:mm:ss` format by using the device `Locale` and `TimeZone`.\n-   custom\\(JSONEncoder, JSONDecoder\\):\n\nUse `custom` coders to have more fine-grained control on JSON decoding/encoding.\n\nOnly use this enumeration to supply your own `JSONEncoder` and `JSONDecoder`, for example when using special date formats, time zones, or locales.\n\n    ```\nlet myEncoder = JSONEncoder()\nmyEncoder.dateFormat = …\nlet myDecoder = JSONDecoder()\nmyDecoder.dateFormat = …\nlet coder: Coder = .custom(myEncoder, myDecoder)\n    ```\n\n\nDefault: .default\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_o4q_3yk_spb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Model, NowDataError&gt;\n\n</td><td>\n\nSuccess: Decodable models that were updated in the specified table.Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code example shows how to call this method.\n\n```\nstruct User: SysIdentifiableModel {\n  var sysId: String = \"\"\n  var name: String\n}\n\nlet user = User(sysId: \"12345\", name: \"abel\")\nlet coder: Coder = .default\n\ntableService.update(user, in: \"sys_user\")\n  .subscribe(on: DispatchQueue.global())\n  .receive(on: DispatchQueue.main)\n  .sink { [weak self] completion in\n    if case let .failure(error) = completion {\n      // Failed to update with NowDataError\n      self?.publish(result: .failure(error))\n    }\n  } receiveValue: { [weak self] updatedModel in\n    do {\n      let data = try coder.jsonEncoder.encode(updatedModel)\n      self?.publish(data: data)\n    } catch {\n      // Failed to update with NowDataError\n      self?.publish(result: .failure(error))\n    }\n  }\n  .store(in: &subscriptions)\n```\n\n## NowTableService - updateRecord\\(sysId: SysID, in tableName: String, withfields: \\[FieldName: FieldValue\\], writeOptions: FieldWriteOptions? = nil, configuration: FieldReadConfiguration? = nil\\) async throws\n\nUpdates the specified record with the specified fields.\n\nYou can decode the data into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\n**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.\n\n<table id=\"table_cjl_5sj_ppb\" 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\nsysId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the record to return from the ServiceNow instance.\n\n</td></tr><tr><td>\n\nwith fields\n\n</td><td>\n\n\\[FieldName: FieldValue\\]\n\n</td><td>\n\nName-value pairs of the fields to include in the record.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_djl_5sj_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nData\n\n</td><td>\n\nReturned when the method is successful. Data object containing the updated record.\n\n</td></tr><tr><td>\n\nNowDataError\n\n</td><td>\n\nThrown when the method fails. -   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>The following code examples shows how to call this method.\n\n```\ndo { \n    let dataResult: Data = try await tableService.updateRecord(with: fields, in: tableName, writeOptions: writeOptions, configuration: configuration) \n    let recordResult: NowRecord = dataResult.convertToRecord() \n} catch { \n    print(\"Record update failed with NowDataError: \\(error)\") \n}\n```\n\n## NowTableService - updateRecord\\(sysId: SysID, in tableName: String, with fields: \\[FieldName: FieldValue\\], writeOptions: FieldWriteOptions? = nil, configuration: FieldReadConfiguration? = nil, completion: @escaping \\(Result&lt;Data, NowDataError&gt;\\)\n\nUpdates the specified record with the specified fields then executes the **completion** handler once the record is saved.\n\nIf needed, you can decode the return results into a custom Codable model or you can use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function instead. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myResult.convertToRecords()\n```\n\n**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.\n\n<table id=\"table_jq5_ttj_ppb\" 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\nsysId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the record to return from the ServiceNow instance.\n\n</td></tr><tr><td>\n\nwith fields\n\n</td><td>\n\n\\[FieldName: FieldValue\\]\n\n</td><td>\n\nName-value pairs of the fields to include in the record.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr><tr><td>\n\ncompletion\n\n</td><td>\n\n@escaping \\(Result&lt;Data, NowDataError&gt;\\)\n\n</td><td>\n\nCompletion handler to execute after the records are retrieved. Return values:\n\n-   Success: Data - Requested records\n-   Error: NowDataError\n    -   `accessToken(AccessTokenProviderError)`\n\n        -   **AccessTokenProviderError**: The access token provider's error code or message.\n            -   accessTokenRetrievalFailed\n            -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n    -   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n    -   `badResponse(statusCode: HTTPStatusCode)`\n\n        -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n    -   `cannotDecodeModel(DecodingError)`\n\n        -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n    -   `cannotDecodeProperty(type: Any, from: String)`\n\n        -   **type**: Wrapped type to decode from a string.\n        -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n    -   `cannotEncodeModel(EncodingError)`\n\n        -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n    -   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n    -   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n    -   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n    -   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n    -   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n    -   `network(NetworkServiceError)`\n\n        -   genericError\\(String\\)\n        -   operationCanceled\n        -   service​Disabled\n        -   serverError\\(Error\\)\n        -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThe following code example shows how to call this method.\n\n```\ntableService.updateRecord(sysId: sysId, in: tableName, with: fields, writeOptions: writeOptions, configuration: readConfiguration) { [weak self] result in\n  switch result {\n    case .success(let data):\n      self?.publish(data: data)\n    case .failure(let error):\n       // Failed to update with NowDataError\n  }\n}\n```\n\n## NowTableService - updateRecord\\(sysId: SysID, in tableName: String, withfields: \\[FieldName: FieldValue\\], writeOptions: FieldWriteOptions? = nil, configuration: FieldReadConfiguration? = nil\\)\n\nUpdates the specified record with the specified fields.\n\n**Note:** This method has been deprecated. You should use the async/await implementation of the method instead.\n\nThe publisher emits data that you can decode into a custom [Codable model](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types), or you can also use the [NowTableService - paginator&lt;Model: Decodable&gt;\\(from tableName: String, path: String = Constants.resultPath, coder: Coder = .default, configuration: FetchConfiguration? = nil\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowTableServiceiOSAPI.md) function. Alternatively, you can use the convenience function convertToRecords\\(\\) to transform data into a NowRecord object. The following shows how to convert a publisher to emit NowRecords:\n\n```\nlet dataPublisher: AnyPublisher<Data, NowDataError> = ...\nlet recordsPublisher: AnyPublisher<[NowRecord], NowDataError> = myPublisher.convertToRecords()\n```\n\n**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.\n\n<table id=\"table_cjl_5sj_ppb\" 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\nsysId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the record to return from the ServiceNow instance.\n\n</td></tr><tr><td>\n\nwith fields\n\n</td><td>\n\n\\[FieldName: FieldValue\\]\n\n</td><td>\n\nName-value pairs of the fields to include in the record.\n\n</td></tr><tr><td>\n\nin tableName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table in which to write the records, such as incident.\n\n</td></tr><tr><td>\n\nwriteOptions\n\n</td><td>\n\n[FieldWriteOptions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FieldWriteOptionsiOSStruct.md)\n\n</td><td>\n\nOptional. Configuration options to apply to the data being written to the record.Default: nil\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\n[FetchConfiguration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/FetchConfigiOSStructure.md)\n\n</td><td>\n\nOptional. Configuration to apply to the retrieved records, including filters that define the records to return, pagination page size limit, which fields to retrieve, and what to include in the fields.Default: nil - All records returned.\n\n</td></tr></tbody>\n</table><table id=\"table_djl_5sj_ppb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAnyPublisher&lt;Data, NowDataError&gt;\n\n</td><td>\n\nSuccess: Data object containing the updated record.Failure: NowDataError\n\n-   `accessToken(AccessTokenProviderError)`\n\n    -   **AccessTokenProviderError**: The access token provider's error code or message.\n        -   accessTokenRetrievalFailed\n        -   userSessionError\\(\\_ error: Error\\)\nThrown when there is an error in the access token.\n\n-   `attachmentValidation`\n\nThrown when an attachment fails validation.\n\n-   `badResponse(statusCode: HTTPStatusCode)`\n\n    -   **HTTPStatusCode**: Status code received from the instance.\nThrown when a request returns an unexpected response\n\n-   `cannotDecodeModel(DecodingError)`\n\n    -   **DecodingError**: Decoding error detected.\nThrown when a Codable model cannot be decoded from JSON.\n\n-   `cannotDecodeProperty(type: Any, from: String)`\n\n    -   **type**: Wrapped type to decode from a string.\n    -   **from**: String to decode to the specified type.\nThrown when a string-wrapped value cannot be decoded from JSON.\n\n-   `cannotEncodeModel(EncodingError)`\n\n    -   **EncodingError**: Encoding error detected.\nThrown when a Codable model cannot be encoded to JSON.\n\n-   `cannotParseResponse`\n\nThrown when a response from the instance cannot be parsed into its expected format.\n\n-   `invalidURL`\n\nThrown when a URL cannot be formed. For example, if the string contains characters that are illegal in a URL or is an empty string.\n\n-   `missingAttachmentMetadata`\n\nThrown when the attachment metadata header is missing.\n\n-   `missingServiceConfiguration`\n\nThrown when an expected service configuration is missing.\n\n-   `missingSysID`\n\nThrown when an expected sys\\_id parameter is missing.\n\n-   `network(NetworkServiceError)`\n\n    -   genericError\\(String\\)\n    -   operationCanceled\n    -   service​Disabled\n    -   serverError\\(Error\\)\n    -   systemError\\(Error\\)\nThrown when a network service encountered an error.\n\n\n</td></tr></tbody>\n</table>This example shows how to create a function that updates a record in the specified table, with the specified fields. The output of the call is a ByteArray which allows you to convert the data into any model that you want.\n\n```\ntableService.updateRecord(sysId: sysId, in: tableName, with: fields, writeOptions: writeOptions, configuration: readConfiguration)\n    .subscribe(on: DispatchQueue.global())\n    .receive(on: DispatchQueue.main)\n    .convertToRecord()\n    .sink { completion in\n        if case let .failure(error) = completion {\n            print(\"Update failed with NowDataError: \\(error)\")\n        }\n    } receiveValue: { record in\n        print(\"Record updated: \\(record)\")\n    }\n    .store(in: &subscriptions)\n```\n\n"}}