Represents an array of data in the submission.
Arrays are either a list or a tuple:
- A list is a set of fields which can be repeated a number of times, with each set being an element in the array.
- A tuple is a fixed set of fields, where each field corresponds to an element in the array.
val repeatableStepExample = Step.build {
id = "Repeatable"
title = ""
schemas {
obj {
id = "#schema"
properties {
list("residency") {
title = "Tax residency"
addItemTitle = "Add a tax residency"
editItemTitle = "Edit a tax residency"
items = OneOfSchema.build {
schemas {
obj {
title = "United Kingdom"
summary = Summary.Provider(providesMedia = true)
media = Media.Avatar.build {
content { uri { uri = "urn:wise:countries:gb:image" } }
}
properties {
const("country") {
title = "United Kingdom"
value("UK")
summary = Summary.Provider(providesTitle = true)
}
}
}
obj {
title = "Spain"
summary = Summary.Provider(providesMedia = true)
media = Media.Avatar.build {
content { uri { uri = "urn:wise:countries:es:image" } }
}
properties {
const("country") {
title = "Spain"
value("ES")
summary = Summary.Provider(providesTitle = true)
}
string("taxNumber") {
title = "NIE Number"
summary = Summary.Provider(providesDescription = true)
}
}
}
}
}
}
}
}
}
layout {
form {
schemaId = "#schema"
}
}
model = encodeToJsonElement(
mapOf(
"residency" to listOf(
mapOf("country" to "UK"),
mapOf(
"country" to "ES",
"taxNumber" to "12345678"
)
)
)
)
}A variable length array where each item matches the items JSON schema. This can be used, for example, to create a repeating form section, or multi-file upload.
If no items are entered, the value for submission is an empty array.
| Property | Type | Required | Description |
|---|---|---|---|
$id | String | No | A unique id which can be used to refer to the schema. |
addItemTitle | String | Yes | The title for the add a new item, and the title for the screen to enter the item info. |
| String | No | Additional information to be displayed to the user.
|
alert | AlertLayout | No | Configure an alert which will be displayed above the UI for this schema. This can be used to provide warnings or additional information to the user, but shouldn't be used for validation. For client-side validation please see the validation available on each schema type, or see Validate Async and Action for server-side validation. |
analyticsId | String | No | An internal id which is attached to analytics events relating to the schema. It allows you to override $id during event emission, it is not user-facing and does not have to be unique within the step. |
control | String | No | An identifier which can be used to request the client use a particular UI control to represent this schema. |
description | String | No | A user-facing description for the schema. |
disabled | Boolean | No | If true, the UI for this schema will not accept input, but the corresponding data will still be submitted. Defaults to false. |
editItemTitle | String | Yes | The title for the screen to edit the item info. |
hidden | Boolean | No | If true, no UI will be shown to the user for this schema, but the corresponding data will still be submitted. Defaults to false. |
icon | Icon | No | An icon which the client can use to represent this entity. |
image | Image | No | An image which the client can use to represent this entity. |
| No | An alert that will be displayed inline with the item.
| |
items | Schema | Yes | A schema which describes the structure of each array element. |
keywords | Array<String> | No | A list of keywords that can be used when searching or filtering items in a One Of Schema. Only applies when this schema is child schema in a One Of Schema. |
maxItems | Int | No | The maximum number of items in the array. |
media | Media | No | A media object which the client can use to represent this entity. |
minItems | Int | No | The minimum number of items in the array. |
persistAsync | PersistAsync | No | |
placeholder | String | No | A user-facing placeholder value to use for the field. This can be used to provide an example of the expected input. |
summary | Summary.Summariser | No | Configure how this schema will be summarised when included in an Array Schema. |
| No | An object containing two strings representing two user-facing values. One being clearly more important than the other.
| |
| Array<String> | No | An optional list of identifiers used to configure renderers.
|
title | String | No | A user-facing title for the schema. |
type | String | Yes | It must be array. |
validationAsync | ValidateAsync | No | |
validationMessages | Map<String, String> | No | An object where each property/value pair is the name of a validation property (e.g. maximum) to the user-facing error message to display if the validation fails. |
A fixed-length array where each schema represents the data at the corresponding element in the array.
As ordering needs to remain consistent, the submission value will include null values where applicable.
The minItems and maxItems validation has no purpose for a tuple, and should be ignored if provided.
| Property | Type | Required | Description |
|---|---|---|---|
$id | String | No | A unique id which can be used to refer to the schema. |
| String | No | Additional information to be displayed to the user.
|
alert | AlertLayout | No | Configure an alert which will be displayed above the UI for this schema. This can be used to provide warnings or additional information to the user, but shouldn't be used for validation. For client-side validation please see the validation available on each schema type, or see Validate Async and Action for server-side validation. |
analyticsId | String | No | An internal id which is attached to analytics events relating to the schema. It allows you to override $id during event emission, it is not user-facing and does not have to be unique within the step. |
control | String | No | An identifier which can be used to request the client use a particular UI control to represent this schema. |
description | String | No | A user-facing description for the schema. |
disabled | Boolean | No | If true, the UI for this schema will not accept input, but the corresponding data will still be submitted. Defaults to false. |
hidden | Boolean | No | If true, no UI will be shown to the user for this schema, but the corresponding data will still be submitted. Defaults to false. |
icon | Icon | No | An icon which the client can use to represent this entity. |
image | Image | No | An image which the client can use to represent this entity. |
| No | An alert that will be displayed inline with the item.
| |
items | Array<Schema> | Yes | An array of schemas which define each element that appears in this array. |
keywords | Array<String> | No | A list of keywords that can be used when searching or filtering items in a One Of Schema. Only applies when this schema is child schema in a One Of Schema. |
media | Media | No | A media object which the client can use to represent this entity. |
persistAsync | PersistAsync | No | |
summary | Summary.Provider | No | Configure how this schema will be summarised when included in an Array Schema. |
| No | An object containing two strings representing two user-facing values. One being clearly more important than the other.
| |
| Array<String> | No | An optional list of identifiers used to configure renderers.
|
title | String | No | A user-facing title for the schema. |
type | String | Yes | It must be array. |
validationAsync | ValidateAsync | No |
inline
Prefer inlined multi-selectable items instead of a drop-down.
inline-checkbox-group
Prefer checkbox group for multi-selectable items.
obj {
id = "#schema"
properties {
list("currencies") {
title = "Select your preferred currencies"
addItemTitle = ""
editItemTitle = ""
control = Control.Schema.Array.INLINE_CHECKBOX_GROUP
items = OneOfSchema.build {
schemas {
const {
title = "USD"
description = "United States dollar"
media = Media.Avatar.build {
content { uri { uri = "urn:wise:currencies:usd:image" } }
}
value("USD")
}
const {
title = "GBP"
description = "British pound"
media = Media.Avatar.build {
content { uri { uri = "urn:wise:currencies:gbp:image" } }
}
value("GBP")
}
const {
title = "EUR"
description = "Euro"
media = Media.Avatar.build {
content { uri { uri = "urn:wise:currencies:eur:image" } }
}
value("EUR")
}
}
}
}
}
}