Skip to main content

Toggle (Boolean)

Toggle is a basic boolean input that has one of two possible values - true and false.
In Port, this input type is represented by a switch that can be toggled on or off.

💡 Common toggle usage​

This input type can be used to store any true/false gate, for example:

  • Is environment locked for deployments
  • Should environment perform nightly shutdown
  • Does service handle PII
  • Is environment public

In the live demo self-service hub page, we can see the Delete Repo action whose Confirm input is a toggle input. 🎬

API definition​

{
"myBooleanInput": {
"title": "My boolean input",
"icon": "My icon",
"description": "My boolean input",
"type": "boolean",
"default": true
}
}

Check out Port's API reference to learn more.

Terraform definition​

resource "port_action" "myAction" {
# ...action properties
user_properties = {
boolean_props = {
myBooleanInput = {
title = "My boolean input"
description = "My boolean input"
default = true
}
}
}
}