Array
Array is an input for lists of data.
💡 Common array usage​
The array input type can be used to store any list of data, for example:
- Configuration parameters
- Ordered values
API definition​
- Basic
- Select (Enum)
{
"myArrayInput": {
"title": "My array input",
"icon": "My icon",
"description": "My array input",
"type": "array",
"default": [1, 2, 3]
}
}
{
"myArraySelectInput": {
"title": "My array select input",
"icon": "My icon",
"description": "My array select input",
"type": "array",
"enum": [
[1, 2, 3],
[1, 2]
]
}
}
Check out Port's API reference to learn more.
Terraform definition​
- Basic
- Select (Enum) - coming soon
resource "port_action" "myAction" {
# ...action properties
user_properties {
identifier = "myArrayInput"
title = "My array input"
description = "My array input"
type = "array"
}
}
Validate array​
Array validations support the following operators:
minItems
maxItems
uniqueItems
tip
Array validations follow the JSON schema model, refer to the JSON schema docs to learn about all of the available validations
- Basic
- Terraform
{
"myArrayInput": {
"title": "My array input",
"icon": "My icon",
"description": "My array input ",
"type": "array",
"minItems": 0,
"maxItems": 5,
"uniqueItems": false
}
}
resource "port_action" "myAction" {
# ...action properties
user_properties = {
array_props = {
"myArrayInput" = {
title = "My array input"
description = "My array input"
min_items = 0
max_items = 5
unique_items = false
}
}
}
}