FieldReadConfiguration structure - iOS
The FieldReadConfiguration structure enables you to configure which fields to fetch from a ServiceNow instance table and in which format.
| Name | Type | Description |
|---|---|---|
| includeFields | Array | List of fields to pass back in the return results. |
| options | Array | List of the types of fields to return. Possible values:
|
FieldReadConfiguration - init(includeFields: [FieldName] = [], options: Options = [])
Configures the fields within a record in a ServiceNow table to pass back in the return results of a REST endpoint call.
| Name | Type | Description |
|---|---|---|
| includeFields | Array | List of fields to pass back in the return results. |
| options | Array | List of the types of fields to return. Possible values:
|
| Type | Description |
|---|---|
| None |
The following code example shows how to call this function.
/// The configuration for what to fetch from the Table API.
lazy var fetchConfiguration: FetchConfiguration = {
let includeFields = [
// Case details
"number",
"short_description",
"priority",
"state",
"opened_at",
// Account details
"account.name",
"account.number",
"contact.name",
"contact.email",
"contact_type",
// Assignment
"assignment_group.name",
"assigned_to.name"
]
let readConfiguration = FieldReadConfiguration(includeFields: includeFields, options: .actualValues)
let filter = Filter(criteria: [], sortBy: [.desc("opened_at")], queryCategory: nil)
return FetchConfiguration(filter: filter, limit: 10, readConfiguration: readConfiguration)
}()