Introduction
The item selector allows you to make single or multiple selections from your catalog entities and use the fields of the selected entities. It offers advanced filtering support, allowing you to narrow down the options of entities to be listed with the filters you define. Additionally, you can use any input value as a filter value within an item-selector configuration. You can wrap the defined filters with logical operators.
The item selector provides users with the same data browsing experience across the project during entity selection. This allows users to easily access the entity to be selected using existing search, filtering, and pagination features.
In this document, we will explore supported catalog entity types, the filter options for these entities, using an input value as a filter, and various scenarios and item-selector usage examples, including changing entity types with conditions.
Item Selector input example
Basic With condition With filter
Copy [
{
"type": "item-selector",
"payloadName": "service_id",
"title": "Single Service selector",
"helpText": "Select a service",
"dataset": {
"data": "{{services()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "selected_services_ids",
"title": "Multiple Service selector",
"multiple": true,
"dataset": {
"data": "{{services()}}",
"value": "id"
}
}
]
Copy [
{
"type": "dropdown",
"payloadName": "type_selector",
"title": "Select a type for next item-selector",
"helpText": "you can see when set a type for next item-selector",
"options": [
{
"value": "service",
"label": "Service"
},
{
"value": "application",
"label": "Application"
}
]
},
{
"type": "item-selector",
"payloadName": "selected_entities",
"title": "Select entity based on selected type",
"helpText": "you will see this when type is isNotEmpty",
"condition": [
{
"when": "type_selector",
"isNotEmpty": true
},
{
"when": "type_selector",
"is": "application",
"then": {
"title": "Select an application",
"dataset": {
"data": "{{applications()}}",
"value": "id"
}
},
"else": {
"title": "Select a service",
"dataset": {
"data": "{{services()}}",
"value": "id"
}
}
}
]
}
]
Copy [
{
"type": "item-selector",
"payloadName": "selected_services_ids",
"title": "Multiple Service selector",
"multiple": true,
"dataset": {
"data": "{{services()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "selected_services_application_id",
"title": "Service's applications",
"helpText": "Select an application from selected services' applications",
"dataset": {
"data": "{{applications()}}",
"value": "id"
},
"filter": [
{
"column": "services",
"operator": "in",
"value": "{{selected_services_ids}}"
}
]
}
]
Supported Catalog Entity Types
Services
The item selector supports service entities. In this section, we will explore the fields of the selected services that you can access.
Here are the fields you can use with dataset.value
for a selected service entity:
You can use these fields like code shown below:
Code
Copy [
{
"type": "item-selector",
"payloadName": "service_id",
"title": "Service selector",
"dataset": {
"data": "{{services()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "service_name",
"title": "Service selector",
"dataset": {
"data": "{{services()}}",
"value": "name"
}
},
{
"type": "item-selector",
"payloadName": "service_createdby",
"title": "Service selector",
"dataset": {
"data": "{{services()}}",
"value": "createdBy"
}
}
]
Applications
The item selector supports application entities. In this section, we will explore the fields of the selected applications that you can access.
Here are the fields you can use with dataset.value
for a selected application entity:
You can use these fields like code shown below:
Code
Copy [
{
"type": "item-selector",
"payloadName": "application_id",
"title": "Application selector",
"dataset": {
"data": "{{applications()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "application_name",
"title": "Application selector",
"dataset": {
"data": "{{applications()}}",
"value": "name"
}
},
{
"type": "item-selector",
"payloadName": "application_createdby",
"title": "Application selector",
"dataset": {
"data": "{{applications()}}",
"value": "createdBy"
}
}
]
Resources
The item selector supports resource entities. In this section, we will explore the fields of the selected resources that you can access.
Here are the fields you can use with dataset.value
for a selected resource entity:
You can use these fields like code shown below:
Code
Copy [
{
"type": "item-selector",
"payloadName": "resource_id",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "resource_name",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "name"
}
},
{
"type": "item-selector",
"payloadName": "resource_provider",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "provider"
}
},
{
"type": "item-selector",
"payloadName": "resource_provider_resource_key",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "providerResourceKey"
}
},
{
"type": "item-selector",
"payloadName": "resource_provider_resource_type",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "providerResourceType"
}
},
{
"type": "item-selector",
"payloadName": "resource_provider_account_id",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "providerAccountId"
}
},
{
"type": "item-selector",
"payloadName": "resource_location",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "location"
}
},
{
"type": "item-selector",
"payloadName": "resource_deep_link_url",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "deepLinkUrl"
}
},
{
"type": "item-selector",
"payloadName": "resource_createdby",
"title": "Resource selector",
"dataset": {
"data": "{{resources()}}",
"value": "createdBy"
}
}
]
Environments
The item selector supports environment entities. In this section, we will explore the fields of the selected environments that you can access.
Here are the fields you can use with dataset.value
for a selected environment entity:
You can use these fields like code shown below:
Code
Copy [
{
"type": "item-selector",
"payloadName": "environment_id",
"title": "Environment selector",
"dataset": {
"data": "{{environments()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "environment_name",
"title": "Environment selector",
"dataset": {
"data": "{{environments()}}",
"value": "name"
}
}
]
Repositories
The item selector supports repository entities. In this section, we will explore the fields of the selected repositories that you can access.
Here are the fields you can use with dataset.value
for a selected repository entity:
You can use these fields like code shown below:
Code
Copy [
{
"type": "item-selector",
"payloadName": "repository_id",
"title": "Repository selector",
"dataset": {
"data": "{{repositories()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "repository_name",
"title": "Repository selector",
"dataset": {
"data": "{{repositories()}}",
"value": "name"
}
},
{
"type": "item-selector",
"payloadName": "repository_provider",
"title": "Repository selector",
"dataset": {
"data": "{{repositories()}}",
"value": "provider"
}
},
{
"type": "item-selector",
"payloadName": "repository_provider_resource_key",
"title": "Repository selector",
"dataset": {
"data": "{{repositories()}}",
"value": "providerResourceKey"
}
},
{
"type": "item-selector",
"payloadName": "repository_provider_resource_type",
"title": "Repository selector",
"dataset": {
"data": "{{repositories()}}",
"value": "providerResourceType"
}
},
{
"type": "item-selector",
"payloadName": "repository_provider_account_id",
"title": "Repository selector",
"dataset": {
"data": "{{repositories()}}",
"value": "providerAccountId"
}
},
{
"type": "item-selector",
"payloadName": "repository_location",
"title": "Repository selector",
"dataset": {
"data": "{{repositories()}}",
"value": "location"
}
}
]
Scorecards
The item selector supports scorecard entities. In this section, we will explore the fields of the selected scorecards that you can access.
Here are the fields you can use with dataset.value
for a selected scorecard entity:
evaluateServicesPercentage
You can use these fields like code shown below:
Code
Copy [
{
"type": "item-selector",
"payloadName": "scorecard_id",
"title": "Scorecard selector",
"dataset": {
"data": "{{scorecards()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "scorecard_name",
"title": "Scorecard selector",
"dataset": {
"data": "{{scorecards()}}",
"value": "name"
}
},
{
"type": "item-selector",
"payloadName": "scorecard_createdby",
"title": "Scorecard selector",
"dataset": {
"data": "{{scorecards()}}",
"value": "createdBy"
}
},
{
"type": "item-selector",
"payloadName": "scorecard_evaluate_total",
"title": "Scorecard selector",
"dataset": {
"data": "{{scorecards()}}",
"value": "evaluateTotal"
}
},
{
"type": "item-selector",
"payloadName": "scorecard_evaluate_passed",
"title": "Scorecard selector",
"dataset": {
"data": "{{scorecards()}}",
"value": "evaluatePassed"
}
},
{
"type": "item-selector",
"payloadName": "scorecard_evaluate_failed",
"title": "Scorecard selector",
"dataset": {
"data": "{{scorecards()}}",
"value": "evaluateFailed"
}
},
{
"type": "item-selector",
"payloadName": "scorecard_evaluate_services_percentage",
"title": "Scorecard selector",
"dataset": {
"data": "{{scorecards()}}",
"value": "evaluateServicesPercentage"
}
}
]
Supported Filter Options
Service filters
In this section, we will explore the supported service filter options and the automatic relational filter options that you can apply when running an action through the service detail page.
Here are the filters that can be applied when working with services using the Item selector:
Column
Supported Operators
* Relational filter
You can use these filters like code shown below:
Basic With applied from Advanced
Copy [
{
"type": "item-selector",
"payloadName": "selected_service",
"title": "Services",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{services()}}",
"value": "id"
},
"filter": [
{
"column": "lifecycle",
"operator": "in",
"value": ["Prod"]
}
]
}
]
When this action is run through an application detail page, only the services related to that specific application will be listed.
Copy [
{
"type": "item-selector",
"payloadName": "selected_service",
"title": "Services",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{application.services()}}",
"value": "id"
}
]
When this action is run from an application detail page, it will list only the services within the relevant application that have a 'prod' lifecycle.
Copy [
{
"type": "item-selector",
"payloadName": "selected_service",
"title": "Services",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{application.services()}}",
"value": "id"
},
"filter": [
{
"column": "lifecycle",
"operator": "in",
"value": ["Prod"]
}
]
]
Application filters
In this section, we will explore the supported application filter options and the automatic relational filter options that you can apply when running an action through the application detail page.
Here are the filters that can be applied when working with applications using the Item selector:
Column
Supported Operators
* Relational filter
You can use these filters like code shown below:
Basic With applied from Advanced
Copy [
{
"type": "item-selector",
"payloadName": "selected_application",
"title": "Applications",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{applications()}}",
"value": "id"
},
"filter": [
{
"column": "owners",
"operator": "in",
"value": ["owner_id_1","owner_id_2"]
}
]
}
]
When this action is run through a service detail page, only the applications related to that specific service will be listed.
Copy [
{
"type": "item-selector",
"payloadName": "selected_application",
"title": "Applications",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.applications()}}",
"value": "id"
}
]
When this action is run from an service detail page, it will list only the applications within the relevant services that have owned by "owner_id_1" and "owner_id_2"
Copy [
{
"type": "item-selector",
"payloadName": "selected_application",
"title": "Applications",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.applications()}}",
"value": "id"
},
"filter": [
{
"column": "owners",
"operator": "in",
"value": ["owner_id_1","owner_id_2"]
}
]
}
]
Resource filters
In this section, we will explore the supported resource filter options and the automatic relational filter options that you can apply when running an action through the resource detail page.
Here are the filters that can be applied when working with resources using the Item selector:
Column
Supported Operators
* Relational filter
You can use these filters like code shown below:
Basic With applied from Advanced
Copy [
{
"type": "item-selector",
"payloadName": "selected_resource",
"title": "Resources",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{resources()}}",
"value": "id"
},
"filter": [
{
"column": "provider",
"operator": "in",
"value": ["AWS"]
},
{
"column": "type",
"operator": "in",
"value": ["AWS:EC2:VPC"]
}
]
}
]
When this action is run through a service detail page, only the resources related to that specific service will be listed.
Copy [
{
"type": "item-selector",
"payloadName": "selected_resource",
"title": "Resources",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.resources()}}",
"value": "id"
}
]
When this action is run through a service detail page, it lists only the resources of the relevant service that have a provider of 'AWS' and a type of 'AWS:EC2:VPC'.
Copy [
{
"type": "item-selector",
"payloadName": "selected_resource",
"title": "Resources",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.resources()}}",
"value": "id"
},
"filter": [
{
"column": "provider",
"operator": "in",
"value": ["AWS"]
},
{
"column": "type",
"operator": "in",
"value": ["AWS:EC2:VPC"]
}
]
}
]
Environment filters
In this section, we will explore the supported environment filter options.
Here are the filters that can be applied when working with environments using the Item selector:
Column
Supported Operators
* Relational filter
You can use these filters like code shown below:
Basic With applied from Advanced
Copy [
{
"type": "item-selector",
"payloadName": "selected_environment",
"title": "Environments",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{environments()}}",
"value": "id"
},
"filter": [
{
"column": "owners",
"operator": "in",
"value": ["owner_id_1","owner_id_2"]
}
]
}
]
When this action is run through a service detail page, only the environments related to that specific service will be listed.
Copy [
{
"type": "item-selector",
"payloadName": "selected_environment",
"title": "Environments",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.environments()}}",
"value": "id"
}
]
When this action is run from an service detail page, it will list only the environments within the relevant services that have owned by "owner_id_1" and "owner_id_2"
Copy [
{
"type": "item-selector",
"payloadName": "selected_environment",
"title": "Environments",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.environments()}}",
"value": "id"
},
"filter": [
{
"column": "owners",
"operator": "in",
"value": ["owner_id_1","owner_id_2"]
}
]
}
]
Repository filters
In this section, we will explore the supported repository filter options.
Here are the filters that can be applied when working with repositories using the Item selector:
Column
Supported Operators
* Relational filter
You can use these filters like code shown below:
Basic With applied from Advanced
Copy [
{
"type": "item-selector",
"payloadName": "selected_repository",
"title": "Repositories",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{repositories()}}",
"value": "id"
},
"filter": [
{
"column": "provider",
"operator": "in",
"value": ["Github"]
}
]
}
]
When this action is run through a service detail page, only the repositories related to that specific service will be listed.
Copy [
{
"type": "item-selector",
"payloadName": "selected_repository",
"title": "Repositories",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.repositories()}}",
"value": "id"
}
]
When this action is run from an service detail page, it will list only the repositories within the relevant services that have a provider of 'Github'
Copy [
{
"type": "item-selector",
"payloadName": "selected_repository",
"title": "Repositories",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.repositories()}}",
"value": "id"
}
"filter": [
{
"column": "provider",
"operator": "in",
"value": ["Github"]
}
]
}
]
Scorecard filters
In this section, we will explore the supported scorecard filter options.
Here are the filters that can be applied when working with scorecards using the Item selector:
Column
Supported Operators
You can use these filters like code shown below:
Basic With applied from Advanced
Copy [
{
"type": "item-selector",
"payloadName": "selected_scorecard",
"title": "Scorecards",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{scorecards()}}",
"value": "id"
},
"filter": [
{
"column": "owners",
"operator": "in",
"value": ["owner_id_1","owner_id_2"]
}
]
}
]
When this action is run through a service detail page, only the scorecards related to that specific service will be listed.
Copy [
{
"type": "item-selector",
"payloadName": "selected_scorecard",
"title": "Scorecards",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.scorecards()}}",
"value": "id"
}
]
When this action is run from an service detail page, it will list only the scorecards within the relevant services that have owned by "owner_id_1" and "owner_id_2"
Copy [
{
"type": "item-selector",
"payloadName": "selected_scorecard",
"title": "Scorecards",
"helpText": "Select an item from filtered items",
"dataset": {
"data": "{{service.scorecards()}}",
"value": "id"
},
"filter": [
{
"column": "owners",
"operator": "in",
"value": ["owner_id_1","owner_id_2"]
}
]
}
]
Dynamic filters
The advanced filtering feature of the item selector allows you to use input values within a filter in your form. If an item-selector filter depends on other input values, it will appear disabled when the related input values are not entered, and it will reset when the related input values are changed.
Filters manually defined as in previous examples can be used alongside dynamic filters within the same item-selector.
Dynamic filter With manual filters
The first input allows you to make multiple selections from all of your services. The second input expects you to make selections from the repositories of the services you selected in the first input.
Copy [
{
"type": "item-selector",
"payloadName": "selected_services",
"title": "Services (multiple)",
"multiple": true,
"dataset": {
"data": "{{services()}}",
"value": "id"
}
},
{
"type": "item-selector",
"payloadName": "selected_repositories",
"title": "Service's repositories",
"multiple": true,
"dataset": {
"data": "{{repositories()}}",
"value": "id"
},
"filter": [
{
"column": "services",
"operator": "in",
"value": "{{selected_services}}"
}
]
}
]
The first input allows you to make multiple selections from your services with a 'Development' lifecycle. The second input expects you to make selections from the applications of the services you selected in the first input, but only from the options managed by 'owner_id_1'.
Copy [
{
"type": "item-selector",
"payloadName": "selected_services",
"title": "Services with predefined lifecycle filter",
"multiple": true,
"dataset": {
"data": "{{services()}}",
"value": "id"
},
"filter": [
{
"column": "lifecycle",
"operator": "eq",
"value": "Development"
}
]
},
{
"type": "item-selector",
"payloadName": "selected_services_applications",
"title": "Selected service's applications with predefined owner filters",
"multiple": true,
"dataset": {
"data": "{{applications()}}",
"value": "id"
},
"filter": [
{
"column": "services",
"operator": "in",
"value": "{{selected_services}}"
},
{
"column": "owners",
"operator": "eq",
"value": "owner_id_1"
}
]
}
]
Logical operators
You can wrap your filters with logical operators.
Logical operators
Copy [
{
"type": "item-selector",
"payloadName": "selected_scorecards_and",
"title": "Multiple predefined filter with logical operator",
"helpText": "checksPassing > 10 & checksPassing < 90",
"multiple": true,
"dataset": {
"data": "{{scorecards()}}",
"value": "id"
},
"filter": {
"and": [
{
"column": "checksPassing",
"operator": "gt",
"value": 10
},
{
"column": "checksPassing",
"operator": "lt",
"value": 90
}
]
}
},
{
"type": "item-selector",
"payloadName": "selected_scorecards_or",
"title": "Multiple predefined filter with logical operator",
"helpText": "checksPassing > 10 || checksPassing < 90",
"multiple": true,
"dataset": {
"data": "{{scorecards()}}",
"value": "id"
},
"filter": {
"or": [
{
"column": "checksPassing",
"operator": "gt",
"value": 10
},
{
"column": "checksPassing",
"operator": "lt",
"value": 90
}
]
}
}
]