Skip to main content

Check out Port for yourselfย 

User Inputs

Each action has a userInputs section in its definition. In this section, you can define all of the user inputs you want your developers and users to fill when invoking the action.

Structureโ€‹

{
"properties": {
"myInput": {
"title": "My input",
"icon": "My icon",
"description": "My input",
"type": "input_type"
}
},
"required": ["myInput"]
}

The different components that make up a basic user input definition are listed in the following table:

FieldDescription
titleThe input's title.
typeMandatory field. The input's data type.
iconThe input's icon. See the full icon list for the available icons.
descriptionA description that can be used to provide detailed information about a specific input or the way it should be used.
defaultA default value for this input in case the action is executed without explicitly providing a value.
property structure

The name of the input is the key of the input object. For example, in the code block above, the name of the input is myInput.

Note that all of the properties available for Port blueprints can also be used as user inputs, which is why they follow the same structure.

Supported input typesโ€‹

Special string formatsโ€‹

In addition to the string formats available in the Blueprint properties section, Port's actions also support the following special formats:

typeDescriptionExample values
entityAn entity of a specified blueprint"notifications-service"
arrayAn array of entities from a specified blueprint["notifications-service", "frontend-service"]

Entityโ€‹

"entity_prop": {
"title": "My string prop",
"type": "string",
"format": "entity",
"blueprint": "microservice",
"description": "This is an entity property"
}

When "format": "entity" is used, a blueprint field is available.

The blueprint field takes an identifier of an existing blueprint. Then, when executing the configured action from Port's UI, the specified field will include a list of existing entities of the selected blueprint from your software catalog to choose from.

Entity arrayโ€‹

"entity_prop": {
"title": "My string prop",
"description": "This property is an array of Entities",
"type": "array",
"items": {
"type": "string",
"blueprint": "service",
"format": "entity"
}
}

When "type": "array" is used, you can create an items property. Under this items property you can use "format": "entity" and write the identifier of the selected blueprint which you want to include entities from. You can then pass an entity array to your action.

Ordering user inputsโ€‹

You can define the order in which the user inputs will be displayed in the UI by using the order field. This field is an array of the input names:

{
"properties": {
"myInput1": {
"title": "My input 1",
"icon": "My icon 1",
"description": "My input 1",
"type": "input_type"
},
"myInput2": {
"title": "My input 2",
"icon": "My icon 2",
"description": "My input 2",
"type": "input_type"
}
},
"required": [],
"order": ["myInput2", "myInput1"]
}