Item Selector

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

[
  {
    "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"
    }
  }
]

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:

  • id

  • name

  • createdBy

You can use these fields like code shown below:

[
    {
        "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:

  • id

  • name

  • createdBy

You can use these fields like code shown below:

[
    {
        "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:

  • id

  • name

  • provider

  • providerResourceKey

  • providerResourceType

  • providerAccountId

  • location

  • deepLinkUrl

  • createdBy

You can use these fields like code shown below:

[
    {
        "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:

  • id

  • name

You can use these fields like code shown below:

[
  {
    "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:

  • id

  • name

  • provider

  • providerResourceKey

  • providerResourceType

  • providerAccountId

  • location

You can use these fields like code shown below:

[
  {
    "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:

  • id

  • name

  • createdBy

  • evaluateTotal

  • evaluatePassed

  • evaluateFailed

  • evaluateServicesPercentage

You can use these fields like code shown below:

[
  {
    "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:

ColumnSupported Operators

applications*

eq, in

environments*

eq, in

resources*

eq, in

scorecards*

eq, in

name

eq

owners

eq, in

tags

eq, in

lifecycle

eq, in

openPRs

eq,lt,lte, gt, gte

incidentsP1

eq,lt,lte, gt, gte

incidentsP2

eq,lt,lte, gt, gte

incidentsP3

eq,lt,lte, gt, gte

incidentsP4

eq,lt,lte, gt, gte

incidentsP5

eq,lt,lte, gt, gte

* Relational filter

You can use these filters like code shown below:

[
  {
    "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"]
      }
    ]
  }
]

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:

ColumnSupported Operators

services*

eq, in

name

eq

owners

eq, in

* Relational filter

You can use these filters like code shown below:

[
  {
    "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"]
      }
    ]
  }
]

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:

ColumnSupported Operators

services*

eq, in

environments*

eq, in

name

eq

provider

eq, in

accountId

eq, in

type

eq, in

availabilityZone

eq, in

mapped

eq

* Relational filter

You can use these filters like code shown below:

[
  {
    "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"]
      }
    ]
  }
]

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:

ColumnSupported Operators

services*

eq, in

name

eq

owners

eq, in

* Relational filter

You can use these filters like code shown below:

[
  {
    "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"]
      }
    ]
  }
]

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:

ColumnSupported Operators

services*

eq, in

name

eq

account

eq, in

provider

eq, in

* Relational filter

You can use these filters like code shown below:

[
  {
    "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"]
      }
    ]
  }
]

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:

ColumnSupported Operators

services

eq, in

name

eq

owners

eq, in

checksPassing

eq,lt,lte, gt, gte

daysLeft

eq,lt,lte, gt, gte

servicesComplete

eq,lt,lte, gt, gte

status

eq

You can use these filters like code shown below:

[
  {
    "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"]
      }
    ]
  }
]

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.

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.

[
  {
    "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}}"
      }
    ]
  }
]

Logical operators

You can wrap your filters with logical operators.

[
    {
        "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
                }
            ]
        }
    }
]

Last updated

Copyright © 2023 configure8, Inc. All rights reserved.