Skip to main content

Check out Port for yourselfย 

Text

Text is a basic input for textual information.

๐Ÿ’ก Common text usageโ€‹

The text input type can be used to store any text based data, for example:

  • Image tags
  • Variable keys
  • Commit SHA
  • File names

In the live demo self-service hub page, we can see the scaffold new service action whose Service Name input is a text input. ๐ŸŽฌ

API definitionโ€‹

{
"myTextInput": {
"title": "My text input",
"icon": "My icon",
"description": "My text input",
"type": "string",
"default": "My default"
}
}

Check out Port's API reference to learn more.

Terraform definitionโ€‹

resource "port_action" "myAction" {
# ...action properties
user_properties = {
string_props = {
myTextInput = {
title = "My text input"
description = "My text input"
default = "My default"
}
}
}
}

Validate textโ€‹

Text validations support the following operators:

  • minLength - enforce minimal string length;
  • maxLength - enforce maximal string length;
  • pattern - enforce Regex patterns.
{
"myTextInput": {
"title": "My text input",
"icon": "My icon",
"description": "My text input",
"type": "string",
"minLength": 1,
"maxLength": 32,
"pattern": "^[a-zA-Z0-9-]*-service$"
}
}