Skip to main content

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​

{
"myArrayInput": {
"title": "My array input",
"icon": "My icon",
"description": "My array input",
"type": "array",
"default": [1, 2, 3]
}
}

Check out Port's API reference to learn more.

Terraform definition​

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

{
"myArrayInput": {
"title": "My array input",
"icon": "My icon",
"description": "My array input ",
"type": "array",
"minItems": 0,
"maxItems": 5,
"uniqueItems": false
}
}