Add Targets

Updated 16 hours ago by Clare Wilkinson

This topic describes how to add Targets to your Environment. Targets are used to control which users see the Variation of a Feature Flag. This is useful when running internal tests or beta programs as you can turn on a new feature for specific users before a broader rollout.

A Target can be any attribute that can be uniquely identified with an entity, for example, an application, system, service, machine, resource identified by an IP address, email ID, user ID, etc.

You can add a Target using the Harness platform. Alternatively, you can directly add a Target and define its attributes in your application's code. The Targets added in your code are discovered automatically and populated in the Harness UI.

Before You Begin

Review: Regex Requirements for Target Names and Identifiers

A Target is identified by a name and an identifier. The name and identifier you enter must conform to the following regex:

Name

Regex: [\\p{L}\\d [email protected]_-]

Must consist of only alphabetical characters, numbers, and the following symbols: 

  • . (period)
  • @ (at sign)
  • - (dash)
  • _ (underscore)

The characters can be lowercase or uppercase and can include accented letters, for example Café_123.

Identifier

Regex: [[email protected]_-]

Must consist of only alphabetical characters, numbers, and the following symbols: 

  • . (period)
  • @ (at sign)
  • - (dash)
  • _ (underscore)

The characters can be lowercase or uppercase but cannot include accented letters, for example CF.789.

Step: Add a Target

The Add Target option allows you to assign individual users to a particular flag variation.

A Target is identified by a name and an identifier. Make sure your Target names and identifiers conform to the regex explained in Review Regex Requirements for Target Names and Identifiers.
  • In Feature Flags, in Target Management, select Targets.
  1. Click + Target(s).
  1. In Add Target(s), select Add a target.
  2. In Name, enter the name that you want to appear in the Target Management page so that you can identify this Target in future.
  3. In Identifier, enter a unique identifier for your Target.
    When Targeting Users with Flags or Managing Target Groups, the Targets are identified by their identifier.
    You can add multiple Targets at once. Click + to add more Targets.
  4. Click Add.

Step: Upload a List of Targets

This option allows you to export a list of users in CSV format.

  1. In Feature Flags, in Target Management, select Targets.
  2. Click + Target(s).
  3. In Add Target(s), select Upload a list of targets.
  4. Upload your CSV file as per the template. The CSV file must have only the Name and Identifier.
    The following table lists a template, where Harness Feature Flag is the Name and FF is the Identifier.

    Target Name

    Target Identifier

    Harness Feature Flag

    FF

    Harness Cloud Cost Management

    CCM

    Harness Continuous Delivery

    [email protected]

    Harness Continuous Integration

    CI2021

  5. Click Add.
    The CSV file with a list of Targets is added.

Next Steps


Please Provide Feedback